This revision was automatically updated to reflect the committed changes. Closed by commit rL261292: [Sema] PR25181 Fix crash when method declaration with throw spec fails to… (authored by rnk).
Changed prior to commit: http://reviews.llvm.org/D17072?vs=47923&id=48435#toc Repository: rL LLVM http://reviews.llvm.org/D17072 Files: cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp cfe/trunk/test/SemaCXX/pr25181-crash-on-invalid.cpp Index: cfe/trunk/test/SemaCXX/pr25181-crash-on-invalid.cpp =================================================================== --- cfe/trunk/test/SemaCXX/pr25181-crash-on-invalid.cpp +++ cfe/trunk/test/SemaCXX/pr25181-crash-on-invalid.cpp @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s +// Don't crash (PR25181). + +template <typename T> class Foo { // expected-note {{template parameter is declared here}} + template <typename T> // expected-error {{declaration of 'T' shadows template parameter}} + void Foo<T>::method(T *) const throw() {} // expected-error {{nested name specifier 'Foo<T>::' for declaration does not refer into a class, class template or class template partial specialization}} +}; Index: cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp =================================================================== --- cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp +++ cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp @@ -52,7 +52,8 @@ } } - HandleMemberFunctionDeclDelays(D, FnD); + if (FnD) + HandleMemberFunctionDeclDelays(D, FnD); D.complete(FnD);
Index: cfe/trunk/test/SemaCXX/pr25181-crash-on-invalid.cpp =================================================================== --- cfe/trunk/test/SemaCXX/pr25181-crash-on-invalid.cpp +++ cfe/trunk/test/SemaCXX/pr25181-crash-on-invalid.cpp @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s +// Don't crash (PR25181). + +template <typename T> class Foo { // expected-note {{template parameter is declared here}} + template <typename T> // expected-error {{declaration of 'T' shadows template parameter}} + void Foo<T>::method(T *) const throw() {} // expected-error {{nested name specifier 'Foo<T>::' for declaration does not refer into a class, class template or class template partial specialization}} +}; Index: cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp =================================================================== --- cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp +++ cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp @@ -52,7 +52,8 @@ } } - HandleMemberFunctionDeclDelays(D, FnD); + if (FnD) + HandleMemberFunctionDeclDelays(D, FnD); D.complete(FnD);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits