aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/exceptions.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-11-28 22:33:28 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-11-28 22:33:28 +0000
commit21173b1080abaa2738f9e700a9d4b0d04f928930 (patch)
tree9799d98307a5cce41be90fcbfa8a08154cc8ee97 /test/SemaCXX/exceptions.cpp
parent060f34d6d12a851faa9463da522f7dff1104d0e1 (diff)
PR14388: An array or function type in an exception specification should be
decayed to a pointer type. Patch by WenHan Gu, with a little tweaking and additional testcases by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/exceptions.cpp')
-rw-r--r--test/SemaCXX/exceptions.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/SemaCXX/exceptions.cpp b/test/SemaCXX/exceptions.cpp
index 486d88eab7..8e32494825 100644
--- a/test/SemaCXX/exceptions.cpp
+++ b/test/SemaCXX/exceptions.cpp
@@ -120,3 +120,26 @@ 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}}
+}