]> granicus.if.org Git - clang/commitdiff
Set the lexical context for dummy tag decl inside createTagFromNewDecl
authorAlex Lorenz <arphaman@gmail.com>
Mon, 14 Aug 2017 10:59:44 +0000 (10:59 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Mon, 14 Aug 2017 10:59:44 +0000 (10:59 +0000)
This is a follow-up to r310706. This change has been recommended by
Bruno Cardoso Lopes and Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310829 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index 667eddec1e17f7a08e7c4eef77fcbc70ddf40b71..8334adbbc079c69e9f42ebb47a5d4bf758084ea1 100644 (file)
@@ -13298,6 +13298,7 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
         AddMsStructLayoutForRecord(RD);
       }
     }
+    New->setLexicalDeclContext(CurContext);
     return New;
   };
 
@@ -13723,7 +13724,6 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
                   // comparison.
                   SkipBody->CheckSameAsPrevious = true;
                   SkipBody->New = createTagFromNewDecl();
-                  SkipBody->New->setLexicalDeclContext(CurContext);
                   SkipBody->Previous = Hidden;
                 } else {
                   SkipBody->ShouldSkip = true;