• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -DTEMPLATE_OVERLOAD -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify %s
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);
test_template_overload()12 void test_template_overload() {
13   (void)new(0) double;
14 }
15 #endif
16 
test_predefined()17 void test_predefined() {
18   (void)new double;
19 }
20