[PATCH] D146719: [Clang] Improve diagnostics when using a concept as template argument

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 25 05:07:41 PDT 2023


cor3ntin added inline comments.


================
Comment at: clang/lib/Parse/Parser.cpp:1886-1889
+  case Sema::NC_Concept:
   case Sema::NC_VarTemplate:
   case Sema::NC_FunctionTemplate:
   case Sema::NC_UndeclaredTemplate: {
----------------
aaron.ballman wrote:
> Would this change make sense, to validate that we're still consuming the token in these three cases? I think it was an assumption we made previously, but it's not clear to me if the code used to consume something other than `<` as well.
I'm not sure. You'll notice that using a var template without template argument does not trigger the assert. That's because `ClassifyName` will return `NC_NonType` instead of `NC_VarTemplate` in that case. I don't think that makes sense either, but that require more investigation. I do think however all template names not followed by arguments should produce a TemplateIdAnnotation so the change is not not correct :)

If you insist, i can put the assert back, but I'm not sure the assert was testing the right thing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146719



More information about the cfe-commits mailing list