[PATCH] D17072: [Sema] PR25181 Fix crash when method declaration with throw spec fails to parse correctly

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 18 17:19:45 PST 2016


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);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17072.48435.patch
Type: text/x-patch
Size: 1107 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160219/0eaa9fe4/attachment-0001.bin>


More information about the cfe-commits mailing list