diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-02-04 01:14:30 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-02-04 01:14:30 +0000 |
commit | bdd146435ff77f63c83823eeec4d763c6fb9a2d8 (patch) | |
tree | d61a74713f68cd0623c1ea8e690bc79f74c0e800 /clang/test/CXX/basic/basic.stc/basic.stc.dynamic | |
parent | 7437589fa186d1f0e58d7528bf9b7351fae5ffdc (diff) | |
download | bcm5719-llvm-bdd146435ff77f63c83823eeec4d763c6fb9a2d8.tar.gz bcm5719-llvm-bdd146435ff77f63c83823eeec4d763c6fb9a2d8.zip |
Add implicit declarations of allocation functions when looking them up for
redeclaration, not just when looking them up for a use -- we need the implicit
declaration to appropriately check various properties of them (notably, whether
they're deleted).
llvm-svn: 200729
Diffstat (limited to 'clang/test/CXX/basic/basic.stc/basic.stc.dynamic')
-rw-r--r-- | clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.allocation/p1.cpp | 3 | ||||
-rw-r--r-- | clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp | 3 |
2 files changed, 4 insertions, 2 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 index 8a62ae84e2a..3b77a62ce7d 100644 --- 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 @@ -9,7 +9,8 @@ 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}} +static void *operator new(size_t); // expected-error {{static declaration of 'operator new' follows non-static declaration}} expected-note {{previous}} +static void *operator new(size_t, int, int); // expected-error {{'operator new' cannot be declared static in global scope}} struct B { void operator new(size_t); // expected-error {{'operator new' must return type 'void *'}} diff --git a/clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp b/clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp index e00e9486f0b..09dde8efde0 100644 --- a/clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp +++ b/clang/test/CXX/basic/basic.stc/basic.stc.dynamic/basic.stc.dynamic.deallocation/p1.cpp @@ -8,4 +8,5 @@ namespace NS { void operator delete(void *); // expected-error {{'operator delete' cannot be declared inside a namespace}} } -static void operator delete(void *); // expected-error {{'operator delete' cannot be declared static in global scope}} +static void operator delete(void *); // expected-error {{follows non-static declaration}} expected-note {{implicit}} +static void operator delete(void *, int, int); // expected-error {{'operator delete' cannot be declared static in global scope}} |