rsmith added inline comments.

================
Comment at: include/clang/AST/Decl.h:1213
+  bool isThisDeclarationADemotedDefinition() const {
+    return NonParmVarDeclBits.IsThisDeclarationADemotedDefinition;
+  }
----------------
This is the bug. You can't read this bit here without first checking whether 
you are a ParmVarDecl, because ParmVarDecls don't have this bit at all.


================
Comment at: include/clang/AST/Decl.h:1222
+  void demoteThisDefinitionToDeclaration() {
+    assert (!isThisDeclarationADemotedDefinition() && "Aleady demoted!");
+    assert (isThisDeclarationADefinition() && "Not a definition!");
----------------
v.g.vassilev wrote:
> rsmith wrote:
> > You can remove this; it's covered by the next line.
> Ok. This would allow calling the method on already demoted definition. Do we 
> want to allow that?
Demoted definitions return false from `isThisDeclarationADefinition()`, so the 
next line catches this case.


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