[clang][concepts] Clang doesn't properly diagnose concept return types with insufficient template arg count #138889
Labels
c++20
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
concepts
C++20 concepts
confirmed
Verified by a second party
Given:
We properly diagnose:
as:
<source>:7:10: error: too many template arguments for concept 'C'
This happens as a part of the call to
InventTemplateParameter
.However, we don't do the same for return types or trailing return types:
Should both diagnose, in Block, File, or Record scope.
However, calls to the
InventTemplateParameter
all need theInventedParameterInfos
to have something in it, which it obviously doesn't, since there are no parameters to be filled in. Likely we need to do something similar with return types, though it isn't clear where that could come from.@zygoloid did something similar in
https://github.com/llvm/llvm-project/commit/9cf98d26e7b1204478cc13ae3df44a6843965c11
for trailing return types, but only applied it to inside a lambda or prototype context, and not File/Block/Record context, so it is incomplete.The text was updated successfully, but these errors were encountered: