new-delete-predefined-decl.cpp revision 4a73ea9c4e87aa111901f3c27b08f0571b58a4cf
1// RUN: %clang_cc1 -DTEMPLATE_OVERLOAD -fsyntax-only -verify %s
2
3#include <stddef.h>
4
5// Note that each test must be run separately so it can be the first operator
6// new declaration in the file.
7
8#if defined(TEMPLATE_OVERLOAD)
9// Don't crash on global template operator new overloads.
10template<typename T> void* operator new(size_t, T);
11void test_template_overload() {
12  (void)new(0) double;
13}
14#endif
15
16void test_predefined() {
17  (void)new double;
18}
19