-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationAnything related to constant evaluationlambdaC++11 lambda expressionsC++11 lambda expressionsregression:21Regression in 21 releaseRegression in 21 release
Description
The following C++17 code should be valid:
template <class>
auto f{[] (auto...) {
if constexpr ([] (auto) { return true; }(0))
return 0;
}};
int main() {
f<int>();
}
Error since Clang 21:
<source>:3:19: error: no matching function for call to object of type '(lambda at <source>:3:19)'
3 | if constexpr ([] (auto) { return true; }(0))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:2:21: note: while substituting into a lambda expression here
2 | auto f{[] (auto...) {
| ^
<source>:8:5: note: in instantiation of variable template specialization 'f' requested here
8 | f<int>();
| ^
<source>:3:19: note: candidate template ignored: couldn't infer template argument 'auto:1'
3 | if constexpr ([] (auto) { return true; }(0))
|
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationAnything related to constant evaluationlambdaC++11 lambda expressionsC++11 lambda expressionsregression:21Regression in 21 releaseRegression in 21 release