Chandler Carruth | 4a73ea9 | 2010-02-03 11:02:14 +0000 | [diff] [blame^] | 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. |
| 10 | template<typename T> void* operator new(size_t, T); |
| 11 | void test_template_overload() { |
| 12 | (void)new(0) double; |
| 13 | } |
| 14 | #endif |
| 15 | |
| 16 | void test_predefined() { |
| 17 | (void)new double; |
| 18 | } |