diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2016-03-16 14:36:11 +0000 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2016-03-16 14:36:11 +0000 |
commit | b94ed614522c7d1ccf4aecb6bd89cdfecee2ceeb (patch) | |
tree | 02dd69fdcc3aa60b6b49bdef9ddd3e7e13aa60ec /clang/test/SemaCXX/destructor.cpp | |
parent | 01b14bf76178a1816957f67aba241d0ecafb178f (diff) | |
download | bcm5719-llvm-b94ed614522c7d1ccf4aecb6bd89cdfecee2ceeb.tar.gz bcm5719-llvm-b94ed614522c7d1ccf4aecb6bd89cdfecee2ceeb.zip |
Fix destructor definition of invalid classes
The declaration of the destructor of an invalid class was not properly marked
as noexcept. As a result, the definition of the same destructor, which was
properly implicitly marked as noexcept, would not match the definition.
This would cause the definition CXXDestructorDecl to be matked as invalid
and omited from the AST.
Differential Revision: http://reviews.llvm.org/D17988
llvm-svn: 263639
Diffstat (limited to 'clang/test/SemaCXX/destructor.cpp')
-rw-r--r-- | clang/test/SemaCXX/destructor.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/destructor.cpp b/clang/test/SemaCXX/destructor.cpp index caff14e9467..fe1dde5771a 100644 --- a/clang/test/SemaCXX/destructor.cpp +++ b/clang/test/SemaCXX/destructor.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fsyntax-only -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -verify %s +// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fsyntax-only -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -fcxx-exceptions -verify %s // RUN: %clang_cc1 -std=c++11 -triple %ms_abi_triple -DMSABI -fsyntax-only -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -verify %s class A { public: @@ -423,3 +423,11 @@ void g(S s) { (s.~S); // expected-error{{reference to destructor must be called}} } } + +class Invalid { + ~Invalid(); + UnknownType xx; // expected-error{{unknown type name}} +}; + +// The constructor definition should not have errors +Invalid::~Invalid() {} |