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
diff --git a/test/SemaCXX/exceptions.cpp b/test/SemaCXX/exceptions.cpp
index 486d88e..8e32494 100644
--- a/test/SemaCXX/exceptions.cpp
+++ b/test/SemaCXX/exceptions.cpp
@@ -120,3 +120,26 @@
     }
   }
 }
+
+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}}
+}