summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/basic
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-12 00:32:00 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-12 00:32:00 +0000
commite363c8e1dfe67f20d768aca2397dae248b9839e6 (patch)
treee3f257e9eb0bacdcc70f64cf8b411ec1818c6405 /clang/test/CXX/basic
parent22f443f58c0b37fea8727d8d7968df31dfa0a1b8 (diff)
downloadbcm5719-llvm-e363c8e1dfe67f20d768aca2397dae248b9839e6.tar.gz
bcm5719-llvm-e363c8e1dfe67f20d768aca2397dae248b9839e6.zip
Correctly diagnose [basic.stc.dynamic.allocation]p1
llvm-svn: 91190
Diffstat (limited to 'clang/test/CXX/basic')
-rw-r--r--clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.allocation/p1.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.allocation/p1.cpp b/clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.allocation/p1.cpp
new file mode 100644
index 00000000000..f8fd9f2dd50
--- /dev/null
+++ b/clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.allocation/p1.cpp
@@ -0,0 +1,12 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+#include <stddef.h>
+
+struct A {
+ void *operator new(size_t);
+};
+
+namespace NS {
+ void *operator new(size_t);; // expected-error {{'operator new' cannot be declared inside a namespace}}
+}
+
+static void *operator new(size_t); // expected-error {{'operator new' cannot be declared static in global scope}}
OpenPOWER on IntegriCloud