[cfe-commits] r131222 - /cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp

Nick Lewycky nicholas at mxc.ca
Wed May 11 20:51:24 PDT 2011


Author: nicholas
Date: Wed May 11 22:51:24 2011
New Revision: 131222

URL: http://llvm.org/viewvc/llvm-project?rev=131222&view=rev
Log:
Fix crasher spotted in IWYU.

Modified:
    cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=131222&r1=131221&r2=131222&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Wed May 11 22:51:24 2011
@@ -2314,7 +2314,8 @@
     Pattern = PatternDecl->getBody(PatternDecl);
 
   // Postpone late parsed template instantiations.
-  if (PatternDecl->isLateTemplateParsed() && !LateTemplateParser) {
+  if (PatternDecl && PatternDecl->isLateTemplateParsed() &&
+      !LateTemplateParser) {
     PendingInstantiations.push_back(
       std::make_pair(Function, PointOfInstantiation));
     return;





More information about the cfe-commits mailing list