-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partycrashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]regression:18Regression in 18 releaseRegression in 18 release
Description
#include <cstdint>
#include <cstddef>
#include <type_traits>
enum Flags : uint64_t
{
LowMemoryNotification = (1 << 0),
AlignedAllocation = (1 << 1),
LazyCommit = (1 << 2),
NoAllocation = (1 << 3),
Entropy = (1 << 4),
Time = (1 << 5),
CoreDump = (1 << 6),
WaitOnAddress = (1 << 7),
};
struct A {
static constexpr uint64_t features = LowMemoryNotification | WaitOnAddress;
using T = int;
};
struct B {
static constexpr uint64_t features = 0;
};
template<Flags F, typename T>
static constexpr bool supports = (T::features & F) == F;
struct AA {
template <class T>
static auto helper() {
if constexpr(supports<Flags::WaitOnAddress, T>)
return typename T::T {};
else {
return char{};
}
}
enum class TA : decltype(helper<A>()) {
A, B, C, D
};
enum class TB : decltype(helper<B>()) {
A, B, C, D
};
};Stacktraces:
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang++-20 ice.cc -c
1. ice.cc:46:6: current parser token ';'
2. ice.cc:34:1: parsing struct/union/class body 'AA'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 libLLVM.so.20.0 0x0000794ff9c4d69f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 63
1 libLLVM.so.20.0 0x0000794ff9c4b3b9 llvm::sys::RunSignalHandlers() + 89
2 libLLVM.so.20.0 0x0000794ff9b92757
3 libc.so.6 0x0000794ff8782320
4 libclang-cpp.so.20.0 0x0000795001b42576 clang::ASTContext::getTypeInfoImpl(clang::Type const*) const + 3814
5 libclang-cpp.so.20.0 0x0000795001b4218b clang::ASTContext::getTypeInfoImpl(clang::Type const*) const + 2811
6 libclang-cpp.so.20.0 0x0000795001b65fd5 clang::ASTContext::getIntWidth(clang::QualType) const + 405
7 libclang-cpp.so.20.0 0x000079500259080f clang::Sema::ActOnEnumBody(clang::SourceLocation, clang::SourceRange, clang::Decl*, llvm::ArrayRef<clang::Decl*>, clang::Scope*, clang::ParsedAttributesView const&) + 1327
8 libclang-cpp.so.20.0 0x0000795001a6da4b clang::Parser::ParseEnumBody(clang::SourceLocation, clang::Decl*) + 3883
9 libclang-cpp.so.20.0 0x0000795001a69583 clang::Parser::ParseEnumSpecifier(clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext) + 6547
10 libclang-cpp.so.20.0 0x0000795001a6473f clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*, clang::ImplicitTypenameContext) + 9215
11 libclang-cpp.so.20.0 0x0000795001a89b9b clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::ParsingDeclRAIIObject*) + 2347
12 libclang-cpp.so.20.0 0x0000795001a8c54c clang::Parser::ParseCXXClassMemberDeclarationWithPragmas(clang::AccessSpecifier&, clang::ParsedAttributes&, clang::TypeSpecifierType, clang::Decl*) + 892
13 libclang-cpp.so.20.0 0x0000795001a86884 clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributes&, unsigned int, clang::Decl*) + 3828
14 libclang-cpp.so.20.0 0x0000795001a8441e clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::ParsedAttributes&) + 8190
15 libclang-cpp.so.20.0 0x0000795001a634d5 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*, clang::ImplicitTypenameContext) + 4501
16 libclang-cpp.so.20.0 0x0000795001b1f2bc clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) + 204
17 libclang-cpp.so.20.0 0x0000795001b1efc5 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) + 565
18 libclang-cpp.so.20.0 0x0000795001b1e184 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) + 2164
19 libclang-cpp.so.20.0 0x0000795001b1c558 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) + 1576
20 libclang-cpp.so.20.0 0x0000795001a4739e clang::ParseAST(clang::Sema&, bool, bool) + 814
21 libclang-cpp.so.20.0 0x0000795003b9e56c clang::FrontendAction::Execute() + 92
22 libclang-cpp.so.20.0 0x0000795003b10ad4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 996
23 libclang-cpp.so.20.0 0x0000795003c1d85c clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 700
24 clang++-20 0x00005ead8b4ee1a2 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 5586
25 clang++-20 0x00005ead8b4eb174
26 libclang-cpp.so.20.0 0x000079500379be22
27 libLLVM.so.20.0 0x0000794ff9b924a7 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 151
28 libclang-cpp.so.20.0 0x000079500379b6b6 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const + 406
29 libclang-cpp.so.20.0 0x0000795003760be9 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 921
30 libclang-cpp.so.20.0 0x0000795003760e5f clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const + 159
31 libclang-cpp.so.20.0 0x000079500377de60 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) + 352
32 clang++-20 0x00005ead8b4eab9b clang_main(int, char**, llvm::ToolContext const&) + 6699
33 clang++-20 0x00005ead8b4f85e3 main + 131
34 libc.so.6 0x0000794ff87671ca
35 libc.so.6 0x0000794ff876728b __libc_start_main + 139
36 clang++-20 0x00005ead8b4e8d75 _start + 37
clang++-20: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Ubuntu clang version 20.0.0 (++20240827082329+cb9267f05515-1~exp1~20240827082434.375)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-20/bin
clang++-20: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++-20: note: diagnostic msg: /tmp/ice-80506b.cpp
clang++-20: note: diagnostic msg: /tmp/ice-80506b.sh
clang++-20: note: diagnostic msg:
********************
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partycrashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]regression:18Regression in 18 releaseRegression in 18 release
Type
Projects
Status
No status