diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-09-06 02:06:12 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-09-06 02:06:12 +0000 |
commit | efa6f736e63a9978d68f47be6e980803452d256d (patch) | |
tree | d5a98324e5863e700e3558af4b02de96ce10026a /clang/test/Parser/cxx-class.cpp | |
parent | d650b82b229eaece6f8ee5f28fee1d7ca91dba06 (diff) | |
download | llvm-efa6f736e63a9978d68f47be6e980803452d256d.zip llvm-efa6f736e63a9978d68f47be6e980803452d256d.tar.gz llvm-efa6f736e63a9978d68f47be6e980803452d256d.tar.bz2 |
Add error, recovery and fixit for "~A::A() {...}".
llvm-svn: 217302
Diffstat (limited to 'clang/test/Parser/cxx-class.cpp')
-rw-r--r-- | clang/test/Parser/cxx-class.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-class.cpp b/clang/test/Parser/cxx-class.cpp index 69776f4..7e820f1 100644 --- a/clang/test/Parser/cxx-class.cpp +++ b/clang/test/Parser/cxx-class.cpp @@ -139,6 +139,20 @@ namespace CtorErrors { }; } +namespace DtorErrors { + struct A { ~A(); } a; + ~A::A() {} // expected-error {{'~' in destructor name should be after nested name specifier}} expected-note {{previous}} + A::~A() {} // expected-error {{redefinition}} + + struct B { ~B(); } *b; + DtorErrors::~B::B() {} // expected-error {{'~' in destructor name should be after nested name specifier}} + + void f() { + a.~A::A(); // expected-error {{'~' in destructor name should be after nested name specifier}} + b->~DtorErrors::~B::B(); // expected-error {{'~' in destructor name should be after nested name specifier}} + } +} + namespace BadFriend { struct A { friend int : 3; // expected-error {{friends can only be classes or functions}} |