[SemaTemplate] Detect instantiation of unparsed exceptions.
This fixes the clang crash reported in PR24000.
Differential Revision: http://reviews.llvm.org/D11341
llvm-svn: 243196
diff --git a/clang/test/SemaTemplate/crash-unparsed-exception.cpp b/clang/test/SemaTemplate/crash-unparsed-exception.cpp
new file mode 100644
index 0000000..1226b35
--- /dev/null
+++ b/clang/test/SemaTemplate/crash-unparsed-exception.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify -fcxx-exceptions -fexceptions %s
+
+struct A {
+ virtual ~A();
+};
+template <class>
+struct B {};
+struct C {
+ template <typename>
+ struct D {
+ ~D() throw();
+ };
+ struct E : A {
+ D<int> d; //expected-error{{exception specification is not available until end of class definition}}
+ };
+ B<int> b; //expected-note{{in instantiation of template class 'B<int>' requested here}}
+};