[PATCH] D24508: PR28752: Do not instantiate var decls which are not visible.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 14 14:52:54 PDT 2016

rsmith added a comment.

I reverted this in r284081, and relanded with fixes described here as r284284.

Comment at: lib/Sema/SemaDecl.cpp:9712
+      // Demote the newly parsed definition to a fake declaration.
+      if (!VDecl->isThisDeclarationADemotedDefinition())
We also need to do this work when MergeVarDecls encounters the same condition.

Comment at: lib/Serialization/ASTReaderDecl.cpp:3087
+          CurD->isThisDeclarationADefinition()) {
+        VD->demoteThisDefinitionToDeclaration();
+        break;
When we do this, we need to tell the ASTContext we merged the definitions, so that the old definition will be made visible whenever the new one is.


More information about the cfe-commits mailing list