aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/exceptions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/exceptions.cpp')
-rw-r--r--test/SemaCXX/exceptions.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/SemaCXX/exceptions.cpp b/test/SemaCXX/exceptions.cpp
index 486d88eab7be..c2ca9f952b22 100644
--- a/test/SemaCXX/exceptions.cpp
+++ b/test/SemaCXX/exceptions.cpp
@@ -120,3 +120,28 @@ namespace PR6831 {
}
}
}
+
+namespace Decay {
+ struct A {
+ void f() throw (A[10]);
+ };
+
+ template<typename T> struct B {
+ void f() throw (B[10]);
+ };
+ template struct B<int>;
+
+ void f() throw (int[10], int(*)());
+ void f() throw (int*, int());
+
+ template<typename T> struct C {
+ void f() throw (T); // expected-error {{pointer to incomplete type 'Decay::E' is not allowed in exception specification}}
+ };
+ struct D {
+ C<D[10]> c;
+ };
+ struct E; // expected-note {{forward declaration}}
+ C<E[10]> e; // expected-note {{in instantiation of}}
+}
+
+void rval_ref() throw (int &&); // expected-error {{rvalue reference type 'int &&' is not allowed in exception specification}} expected-warning {{C++11}}