[PATCH] D94933: [clang] Check for nullptr when instantiating late attrs

Adam Czachorowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 19 04:53:24 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa6f9077b16da: [clang] Check for nullptr when instantiating late attrs (authored by adamcz).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94933/new/

https://reviews.llvm.org/D94933

Files:
  clang/lib/Sema/SemaTemplateInstantiate.cpp


Index: clang/lib/Sema/SemaTemplateInstantiate.cpp
===================================================================
--- clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -2796,7 +2796,8 @@
 
     Attr *NewAttr =
       instantiateTemplateAttribute(I->TmplAttr, Context, *this, TemplateArgs);
-    I->NewDecl->addAttr(NewAttr);
+    if (NewAttr)
+      I->NewDecl->addAttr(NewAttr);
     LocalInstantiationScope::deleteScopes(I->Scope,
                                           Instantiator.getStartingScope());
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94933.317528.patch
Type: text/x-patch
Size: 562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210119/6c22d338/attachment.bin>


More information about the cfe-commits mailing list