Building dev-libs/boost on an llvm system produces an ICE from the compiler. Reproducible: Always Steps to Reproduce: 1.Try to build boost with clang-17.0.0_rc2 Actual Results: ICE Expected Results: It builds fine clang++: /usr/lib/llvm/17/include/llvm/Support/Casting.h:578: decltype(auto) llvm::cast(From *) [To = clang::CXXConstructExpr, From = clang::Expr]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed. 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++ -fvisibility-inlines-hidden -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -pipe -std=c++17 -fPIC -m64 -pthread -finline-functions -Wno-inline -Wall -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_URL_DYN_LINK=1 -DBOOST_URL_SOURCE -DNDEBUG -I. -c -o bin.v2/libs/url/build/gcc-4.2/gentoorelease/pch-off/threading-multi/visibility-hidden/segments_view.o libs/url/src/segments_view.cpp 1. libs/url/src/segments_view.cpp:34:1: current parser token '{' 2. libs/url/src/segments_view.cpp:18:1: parsing namespace 'boost' 3. libs/url/src/segments_view.cpp:19:1: parsing namespace 'boost::urls' #0 0x00007fc9f84ff836 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm/17/bin/../lib64/libLLVM-17+libcxx.so+0x4aff836) #1 0x00007fc9f84fcd30 llvm::sys::RunSignalHandlers() (/usr/lib/llvm/17/bin/../lib64/libLLVM-17+libcxx.so+0x4afcd30) #2 0x00007fc9f840bfd9 (/usr/lib/llvm/17/bin/../lib64/libLLVM-17+libcxx.so+0x4a0bfd9) #3 0x00007fc9f3759930 (/lib64/libc.so.6+0x38930) #4 0x00007fc9f37a69fc __pthread_kill_implementation /var/tmp/notmpfs/portage/sys-libs/glibc-2.37-r4/work/glibc-2.37/nptl/pthread_kill.c:44:76 #5 0x00007fc9f3759892 raise /var/tmp/notmpfs/portage/sys-libs/glibc-2.37-r4/work/glibc-2.37/signal/../sysdeps/posix/raise.c:27:6 #6 0x00007fc9f37434ad abort /var/tmp/notmpfs/portage/sys-libs/glibc-2.37-r4/work/glibc-2.37/stdlib/abort.c:81:7 #7 0x00007fc9f37433d5 _nl_load_domain /var/tmp/notmpfs/portage/sys-libs/glibc-2.37-r4/work/glibc-2.37/intl/loadmsgcat.c:1177:9 #8 0x00007fc9f3752652 (/lib64/libc.so.6+0x31652) #9 0x00007fc9ffea0080 clang::Sema::BuildDelegatingInitializer(clang::TypeSourceInfo*, clang::Expr*, clang::CXXRecordDecl*) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Sema/SemaDeclCXX.cpp:4643:5 #10 0x00007fc9ffe9f744 clang::Sema::BuildBaseInitializer(clang::QualType, clang::TypeSourceInfo*, clang::Expr*, clang::CXXRecordDecl*, clang::SourceLocation) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Sema/SemaDeclCXX.cpp:4724:14 #11 0x00007fc9ffe9decf clang::Sema::BuildMemInitializer(clang::Decl*, clang::Scope*, clang::CXXScopeSpec&, clang::IdentifierInfo*, clang::OpaquePtr<clang::QualType>, clang::DeclSpec const&, clang::SourceLocation, clang::Expr*, clang::SourceLocation) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Sema/SemaDeclCXX.cpp:0:0 #12 0x00007fc9ffe9e7f1 clang::Sema::ActOnMemInitializer(clang::Decl*, clang::Scope*, clang::CXXScopeSpec&, clang::IdentifierInfo*, clang::OpaquePtr<clang::QualType>, clang::DeclSpec const&, clang::SourceLocation, clang::SourceLocation, llvm::ArrayRef<clang::Expr*>, clang::SourceLocation, clang::SourceLocation) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Sema/SemaDeclCXX.cpp:4298:10 #13 0x00007fc9ff20fd59 clang::Parser::ParseMemInitializer(clang::Decl*) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/ParseDeclCXX.cpp:3866:20 #14 0x00007fc9ff20ecf8 clang::Parser::ParseConstructorInitializer(clang::Decl*) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/ParseDeclCXX.cpp:0:0 #15 0x00007fc9ff2b9dda clang::Token::is(clang::tok::TokenKind) const /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/include/clang/Lex/Token.h:98:49 #16 0x00007fc9ff2b9dda clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/Parser.cpp:1459:14 #17 0x00007fc9ff1d7e76 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/ParseDecl.cpp:2197:18 #18 0x00007fc9ff2b8635 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/Parser.cpp:0:10 #19 0x00007fc9ff2b7de3 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/Parser.cpp:0:0 #20 0x00007fc9ff2b6d03 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/Parser.cpp:0:14 #21 0x00007fc9ff1fac89 clang::AttributePool::~AttributePool() /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/include/clang/Sema/ParsedAttr.h:704:22 #22 0x00007fc9ff1fac89 clang::ParsedAttributes::~ParsedAttributes() /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/include/clang/Sema/ParsedAttr.h:920:7 #23 0x00007fc9ff1fac89 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/ParseDeclCXX.cpp:263:5 #24 0x00007fc9ff1fa0a3 clang::Parser::ParseScope::Exit() /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/include/clang/Parse/Parser.h:1143:15 #25 0x00007fc9ff1fa0a3 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/ParseDeclCXX.cpp:242:18 #26 0x00007fc9ff1d5df8 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/ParseDecl.cpp:0:12 #27 0x00007fc9ff2b6794 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/Parser.cpp:0:14 #28 0x00007fc9ff1fac89 clang::AttributePool::~AttributePool() /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/include/clang/Sema/ParsedAttr.h:704:22 #29 0x00007fc9ff1fac89 clang::ParsedAttributes::~ParsedAttributes() /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/include/clang/Sema/ParsedAttr.h:920:7 #30 0x00007fc9ff1fac89 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/ParseDeclCXX.cpp:263:5 #31 0x00007fc9ff1fa0a3 clang::Parser::ParseScope::Exit() /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/include/clang/Parse/Parser.h:1143:15 #32 0x00007fc9ff1fa0a3 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/ParseDeclCXX.cpp:242:18 #33 0x00007fc9ff1d5df8 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/ParseDecl.cpp:0:12 #34 0x00007fc9ff2b6794 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/Parser.cpp:0:14 #35 0x00007fc9ff2b4599 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/Parser.cpp:742:10 #36 0x00007fc9ff1c128e clang::ParseAST(clang::Sema&, bool, bool) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Parse/ParseAST.cpp:162:5 #37 0x00007fca0167a623 clang::FrontendAction::Execute() /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Frontend/FrontendAction.cpp:1062:10 #38 0x00007fca015e1a7d llvm::Error::getPtr() const /usr/lib/llvm/17/include/llvm/Support/Error.h:270:42 #39 0x00007fca015e1a7d llvm::Error::operator bool() /usr/lib/llvm/17/include/llvm/Support/Error.h:233:16 #40 0x00007fca015e1a7d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Frontend/CompilerInstance.cpp:1053:23 #41 0x00007fca01708f26 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:0:0 #42 0x000055c1d92113d9 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/tools/driver/cc1_main.cpp:0:0 #43 0x000055c1d920e81f ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/tools/driver/driver.cpp:0:12 #44 0x00007fca012013e9 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const::$_0::operator()() const /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Driver/Job.cpp:440:30 #45 0x00007fca012013e9 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const::$_0>(long) /usr/lib/llvm/17/include/llvm/ADT/STLFunctionalExtras.h:45:12 #46 0x00007fc9f840bc46 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/llvm/17/bin/../lib64/libLLVM-17+libcxx.so+0x4a0bc46) #47 0x00007fca012009ed clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Driver/Job.cpp:440:7 #48 0x00007fca011bf43f clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Driver/Compilation.cpp:0:0 #49 0x00007fca011bf7de clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&, bool) const /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Driver/Compilation.cpp:253:13 #50 0x00007fca011df88c llvm::SmallVectorBase<unsigned int>::empty() const /usr/lib/llvm/17/include/llvm/ADT/SmallVector.h:94:46 #51 0x00007fca011df88c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/lib/Driver/Driver.cpp:1906:23 #52 0x000055c1d920d736 clang_main(int, char**, llvm::ToolContext const&) /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/clang/tools/driver/driver.cpp:0:0 #53 0x000055c1d921dda2 main /var/tmp/notmpfs/portage/sys-devel/clang-17.0.0_rc2/work/x/y/clang-abi_x86_64.amd64/tools/driver/clang-driver.cpp:15:3 #54 0x00007fc9f374478a __libc_start_call_main /var/tmp/notmpfs/portage/sys-libs/glibc-2.37-r4/work/glibc-2.37/csu/../sysdeps/nptl/libc_start_call_main.h:74:3 #55 0x00007fc9f3744845 call_init /var/tmp/notmpfs/portage/sys-libs/glibc-2.37-r4/work/glibc-2.37/csu/../csu/libc-start.c:128:20 #56 0x00007fc9f3744845 __libc_start_main /var/tmp/notmpfs/portage/sys-libs/glibc-2.37-r4/work/glibc-2.37/csu/../csu/libc-start.c:347:5 #57 0x000055c1d920a791 _start (/usr/lib/llvm/17/bin/clang-17+0x11791) clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation) clang version 17.0.0 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm/17/bin Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang++.cfg clang++: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang++: note: diagnostic msg: /var/tmp/portage/dev-libs/boost-1.83.0-r1/temp/segments_view-205859.cpp clang++: note: diagnostic msg: /var/tmp/portage/dev-libs/boost-1.83.0-r1/temp/segments_view-205859.sh clang++: note: diagnostic msg:
Created attachment 868268 [details] emerge --info
Created attachment 868269 [details] dev-libs/boost-1.83.0-r1 build.log gzip compressed
Created attachment 868270 [details] Script from the output
Created attachment 868271 [details] Preprocessed source from the output (gzip compressed)
Reported to llvm bug tracker https://github.com/llvm/llvm-project/issues/64885
The assertion is only hit when debug use flag is enabled in clang.
there seems to be some kind of progress in one of the linked pullrequests (39319), you might want to revisit and test for backportability of the fix.
(In reply to tt_1 from comment #7) > there seems to be some kind of progress in one of the linked pullrequests > (39319), you might want to revisit and test for backportability of the fix. I don't really consider USE=debug a priority and I don't see it as worthwhile unless it's trivial to backport, and even then... Does this really matter that much to you? If so, why?