-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsC++20 conceptsconfirmedVerified by a second partyVerified by a second partycrashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]lambdaC++11 lambda expressionsC++11 lambda expressions
Description
Both were discovered in #133719, but the underlying causes are different from the original issue so I filed a separate one to track these.
- The following code causes clang to crash, dating back to Clang 16 and up to trunk:
template <class T>
constexpr auto f{[] (auto arg) {
return [a{arg}] {
[] () requires (a == 1) {}();
};
}};
int main() {
f<int>(0);
}
https://compiler-explorer.com/z/Tq9xzrPns
- Clang accepts the following code, while others don't (discovered by @shafik)
void f() {
auto f{
[](auto arg) {
return [a = arg]()
requires (a == 1)
{ return a;};
}
};
f(10);
}
https://godbolt.org/z/ncYx8q9f6
This has started since Clang 16.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsC++20 conceptsconfirmedVerified by a second partyVerified by a second partycrashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]lambdaC++11 lambda expressionsC++11 lambda expressions