aaron.ballman added inline comments.

================
Comment at: clang/lib/Sema/SemaType.cpp:3092-3094
+    SourceLocation Loc = D.getIdentifierLoc();
+    if (Loc.isInvalid())
+      Loc = FTI.getRParenLoc();
----------------
aaronpuchert wrote:
> I'm open to always using the `RParenLoc`.
Any reason not to track the trailing return type location on the 
`DeclaratorChunk::FunctionTypeInfo` object? That already tracks whether the 
return type is trailing or not as well as a bunch of other source location 
information.

The right paren loc isn't necessarily a good place given the grammar allows a 
*lot* of optional stuff between the closing paren and the trailing return type: 
http://eel.is/c++draft/dcl.decl#general-5


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90129

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

Reply via email to