Closed
Description
Bugzilla Link | 48838 |
Version | trunk |
OS | All |
Attachments | Patch to reject concepts with parameter packs not at the end |
CC | @zygoloid |
Extended Description
There are no errors or warnings compiling the following with clang++ -std=c++20 -fsyntax-only
:
template<typename, typename..., typename = int>
concept invalid = true;
template<typename> requires invalid<int>
no errors are printed
;
static_assert(invalid<int> also here ;
int main() {
bool b;
b = invalid<int> not just in declarations;
return b;
}
This happens because this assumption is violated with concepts:
llvm-project/clang/lib/Sema/SemaTemplate.cpp
Lines 5756 to 5760 in 39239f9
I have attached a patch that makes concepts like invalid
which have a parameter pack not at the end an error.
There is currently no wording in the standard that makes these concepts ill-formed (The current C++20 [temp.param]p14 only mentions "primary class template, primary variable template, or alias template"), but I think this is an oversight.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done