-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partyrejects-valid
Description
Compile with -std=c++20
:
template <auto A = [](auto x){}>
struct C {
static constexpr auto B = A;
};
int main() {
C<>::B(42);
}
result:
<source>:8:3: error: no matching function for call to object of type 'const (lambda at <source>:2:20)'
C<>::B(42);
^~~~~~
<source>:2:20: note: candidate template ignored: couldn't infer template argument 'x:auto'
template <auto A = [](auto x){}>
^
1 error generated.
I can't fathom why the compiler cannot infer the type of the lambda argument.
Metadata
Metadata
Assignees
Labels
c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partyrejects-valid