Index: cfe/trunk/lib/Sema/SemaExceptionSpec.cpp =================================================================== --- cfe/trunk/lib/Sema/SemaExceptionSpec.cpp +++ cfe/trunk/lib/Sema/SemaExceptionSpec.cpp @@ -161,7 +161,13 @@ else InstantiateExceptionSpec(Loc, SourceDecl); - return SourceDecl->getType()->castAs(); + const FunctionProtoType *Proto = + SourceDecl->getType()->castAs(); + if (Proto->getExceptionSpecType() == clang::EST_Unparsed) { + Diag(Loc, diag::err_exception_spec_not_parsed); + Proto = nullptr; + } + return Proto; } void Index: cfe/trunk/test/SemaTemplate/crash-unparsed-exception.cpp =================================================================== --- cfe/trunk/test/SemaTemplate/crash-unparsed-exception.cpp +++ cfe/trunk/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 +struct B {}; +struct C { + template + struct D { + ~D() throw(); + }; + struct E : A { + D d; //expected-error{{exception specification is not available until end of class definition}} + }; + B b; //expected-note{{in instantiation of template class 'B' requested here}} +};