Chandler Carruth | 4a73ea9 | 2010-02-03 11:02:14 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -DTEMPLATE_OVERLOAD -fsyntax-only -verify %s |
Douglas Gregor | a301ac3 | 2010-02-12 06:08:51 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Chandler Carruth | 4a73ea9 | 2010-02-03 11:02:14 +0000 | [diff] [blame] | 3 | |
| 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. |
| 11 | template<typename T> void* operator new(size_t, T); |
| 12 | void test_template_overload() { |
| 13 | (void)new(0) double; |
| 14 | } |
| 15 | #endif |
| 16 | |
| 17 | void test_predefined() { |
| 18 | (void)new double; |
| 19 | } |