mizvekov added inline comments.

================
Comment at: clang/lib/Sema/SemaType.cpp:5947-5948
       TL.setNameLoc(DS.getTypeSpecTypeLoc());
       if (!DS.isConstrainedAuto())
         return;
       if (DS.getTypeSpecScope().isNotEmpty())
----------------
rsmith wrote:
> Given that we recover from an invalid `TemplateId` by creating an 
> unconstrained `AutoType`, it would be more consistent to skip filling in the 
> `NestedNameSpecifierLoc` here in that case too. (That way, we would populate 
> the `NestedNameSpecifierLoc` if and only if we created a constrained 
> `AutoType`.) I think it doesn't matter right now because no-one should look 
> at this information for an unconstrained `AutoType`, but I could imagine we 
> would switch to storing smaller `TypeLoc` data in the future if the type is 
> unconstrained, and if we did, the writes to the `NestedNameSpecifierLoc` 
> below would break.
Good catch, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98095

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

Reply via email to