rsmith accepted this revision.
rsmith added inline comments.
This revision is now accepted and ready to land.


================
Comment at: include/clang/AST/Decl.h:1222
+  void demoteThisDefinitionToDeclaration() {
+    assert (!isThisDeclarationADemotedDefinition() && "Aleady demoted!");
+    assert (isThisDeclarationADefinition() && "Not a definition!");
----------------
You can remove this; it's covered by the next line.


================
Comment at: lib/AST/Decl.cpp:2284
+      while (auto *NewVD = VD->getInstantiatedFromStaticDataMember())
+        VD = NewVD;
+      return VD->getDefinition();
----------------
Missing a member specialization check here.


================
Comment at: lib/Serialization/ASTReaderDecl.cpp:3086-3090
+      if (CurD->isThisDeclarationADemotedDefinition()) {
+        VD->demoteThisDefinitionToDeclaration();
+        break;
+      }
+      if (CurD->isThisDeclarationADefinition()) {
----------------
Maybe combine these two `if`s into one, since their bodies are identical?


https://reviews.llvm.org/D24508



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to