-
Notifications
You must be signed in to change notification settings - Fork 12.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clang crashes when a consteval function has multiple diagnostics in flight #68542
Comments
@llvm/issue-subscribers-clang-frontend
Apologies for the terrible title: this is difficult to summarise. Clang will crash with the following code (that's a repro of real code). Observations:
struct S {
int e;
};
template<class T>
consteval int get_format()
{
return nullptr;
}
template<class T>
constexpr S f(T) noexcept
{
return get_format<T>();
}
constexpr S x = f(0); Observed on: dae91f5 (trunk), e19b7dc (17.0.1), not present in 16.0.0
|
Apologies for the terrible title: this is difficult to summarise. Clang will crash with the following code (that's a repro of real code). Observations:
get_format
andf
must both be templatesget_format
must beconsteval
f
's return statement must try to initialise something that isn't actually a memberget_format
andf
need to generate a Sema diagnosticObserved on: dae91f5 (trunk), e19b7dc (17.0.1), not present in 16.0.0
Requires assertions: Yes.
Options:
-gdwarf-4 -g -o /tmp/compiler-explorer-compiler202399-6962-m3zjz9.pmcim/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++20 /tmp/compiler-explorer-compiler202399-6962-m3zjz9.pmcim/example.cpp
Diagnostics:
The text was updated successfully, but these errors were encountered: