Reinstate fix for PR7526, which was failing because, now that we
aren't dropping all exception specifications on destructors, the
exception specifications on implicitly-declared destructors were
detected as being wrong (which they were).
Introduce logic to provide a proper exception-specification for
implicitly-declared destructors. This also fixes PR6972.
Note that the other implicitly-declared special member functions also
need to get exception-specifications. I'll deal with that in a
subsequent commit.
llvm-svn: 107385
diff --git a/clang/test/SemaCXX/destructor.cpp b/clang/test/SemaCXX/destructor.cpp
index ae3dc86..3c63c3d 100644
--- a/clang/test/SemaCXX/destructor.cpp
+++ b/clang/test/SemaCXX/destructor.cpp
@@ -19,7 +19,9 @@
// expected-error{{type qualifier is not allowed on this function}} \
// expected-error{{destructor cannot be declared 'static'}} \
// expected-error{{destructor cannot have any parameters}} \
- // expected-error{{destructor cannot be variadic}}
+ // expected-error{{destructor cannot be variadic}} \
+ // expected-error{{destructor cannot have a return type}} \
+ // expected-error{{'const' qualifier is not allowed on a destructor}}
};
struct D2 {
@@ -83,3 +85,6 @@
template<class T> class X { T v; ~X() { ++*v; } };
void a(X<int> x) {}
}
+
+struct X0 { virtual ~X0() throw(); };
+struct X1 : public X0 { };