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


================
Comment at: clang/include/clang/Sema/DeclSpec.h:2068
     case DeclaratorContext::TrailingReturnVar:
+    case DeclaratorContext::Association:
       return false;
----------------
aaron.ballman wrote:
> erichkeane wrote:
> > Is this right?  According to the comment, this is 'true'if the identifier 
> > is optional or required, but the mayOmitIdentifier, where you are returning 
> > 'true' says optional or not allowed?  Does this make identifier 'not 
> > allowed' here?
> I believe this is correct -- associations used to be handled the same as type 
> names, and we still want to handle them effectively as type names. The only 
> distinction between an association and a type name is whether it can be a 
> defining type specifier or not (type  name can be, association cannot be).
> 
> This is the function that tests whether you can put an identifier after the 
> type; e.g., `int a` and I think it's logically consistent. May the identifier 
> be omitted? Certainly, it must be. May it have an identifier? Definitely not.
Ok, that sounds right to me as well then. Its a little annoying/confusing I 
guess that these two functions combine for a bizarre tri-state: 
"Required/Optional/Not-allowed", and the name of `mayOmitIdentifier` isn't 
really a good one, since `may I omit` implies the option here...

Either way, not your ball of wax, but thanks for confirming.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126969/new/

https://reviews.llvm.org/D126969

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

Reply via email to