[PATCH] D90129: Source location for -Wignored-qualifiers on lambda trailing return type

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 27 10:00:47 PDT 2020


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



More information about the cfe-commits mailing list