blob: 20b15b729cd045401cf8dd42cf429e285090c23d [file] [log] [blame]
Chandler Carruth4a73ea92010-02-03 11:02:14 +00001// RUN: %clang_cc1 -DTEMPLATE_OVERLOAD -fsyntax-only -verify %s
Douglas Gregora301ac32010-02-12 06:08:51 +00002// RUN: %clang_cc1 -fsyntax-only -verify %s
Chandler Carruth4a73ea92010-02-03 11:02:14 +00003
4#include <stddef.h>
5
6// Note that each test must be run separately so it can be the first operator
7// new declaration in the file.
8
9#if defined(TEMPLATE_OVERLOAD)
10// Don't crash on global template operator new overloads.
11template<typename T> void* operator new(size_t, T);
12void test_template_overload() {
13 (void)new(0) double;
14}
15#endif
16
17void test_predefined() {
18 (void)new double;
19}