summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/new-delete-predefined-decl.cpp
blob: 20b15b729cd045401cf8dd42cf429e285090c23d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: %clang_cc1 -DTEMPLATE_OVERLOAD -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify %s

#include <stddef.h>

// Note that each test must be run separately so it can be the first operator
// new declaration in the file.

#if defined(TEMPLATE_OVERLOAD)
// Don't crash on global template operator new overloads.
template<typename T> void* operator new(size_t, T);
void test_template_overload() {
  (void)new(0) double;
}
#endif

void test_predefined() {
  (void)new double;
}