[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
Thu Mar 23 06:34:40 PDT 2023


cor3ntin created this revision.
Herald added a project: All.
cor3ntin requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

When using the name of a template variable or concept in places
where an expression was expected, Clang would drop the cxxscope token
preceeding it, if any.

This leads to subpar diagnostics - complaining about the
identifier being undeclared as clang would not know to look into a
non-global scope.

We make sure the scope is preserved.

When encountering `ns::Concept foo x;`, Clang would also fail
to provide the same quality as it does at global scope.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146719

Files:
  clang/lib/Parse/ParseDecl.cpp
  clang/lib/Parse/Parser.cpp
  clang/test/Parser/cxx-template-template-recovery.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146719.507721.patch
Type: text/x-patch
Size: 4517 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230323/61d8ea18/attachment.bin>


More information about the cfe-commits mailing list