r310829 - Set the lexical context for dummy tag decl inside createTagFromNewDecl

Alex Lorenz via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 14 03:59:44 PDT 2017


Author: arphaman
Date: Mon Aug 14 03:59:44 2017
New Revision: 310829

URL: http://llvm.org/viewvc/llvm-project?rev=310829&view=rev
Log:
Set the lexical context for dummy tag decl inside createTagFromNewDecl

This is a follow-up to r310706. This change has been recommended by
Bruno Cardoso Lopes and Richard Smith.

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

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=310829&r1=310828&r2=310829&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Aug 14 03:59:44 2017
@@ -13298,6 +13298,7 @@ Decl *Sema::ActOnTag(Scope *S, unsigned
         AddMsStructLayoutForRecord(RD);
       }
     }
+    New->setLexicalDeclContext(CurContext);
     return New;
   };
 
@@ -13723,7 +13724,6 @@ Decl *Sema::ActOnTag(Scope *S, unsigned
                   // comparison.
                   SkipBody->CheckSameAsPrevious = true;
                   SkipBody->New = createTagFromNewDecl();
-                  SkipBody->New->setLexicalDeclContext(CurContext);
                   SkipBody->Previous = Hidden;
                 } else {
                   SkipBody->ShouldSkip = true;




More information about the cfe-commits mailing list