blob: ae100653611281ae744615fe91f6220748747bb2 [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
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00003// expected-no-diagnostics
Chandler Carruth4a73ea92010-02-03 11:02:14 +00004
5#include <stddef.h>
6
7// Note that each test must be run separately so it can be the first operator
8// new declaration in the file.
9
10#if defined(TEMPLATE_OVERLOAD)
11// Don't crash on global template operator new overloads.
12template<typename T> void* operator new(size_t, T);
13void test_template_overload() {
14 (void)new(0) double;
15}
16#endif
17
18void test_predefined() {
19 (void)new double;
20}