hi, my compiler crashed on me as i was building a tiny modules project. it seems like a regression but i'm honestly a little confused because the project is almost 1:1 to another project of mine where this issue didn't occur. requested files attached below, i've also included the entire project i was building, it's just a couple of files:
.
Stack dump:
0. Program arguments: clang++ -std=c++23 -stdlib=libc++ -fprebuilt-module-path=target -Wall -Wconversion -Werror -Wextra -Wno-reserved-module-identifier -Wpedantic -funsigned-char -x c++-module -c -o target/main.o -fmodule-output=target/main.pcm src/main.cxx
1. src/main.cxx:7:8: current parser token 'cout'
2. src/main.cxx:6:1: parsing function body 'main'
3. src/main.cxx:6:1: in compound statement ('{}')
#0 0x00007f24c503c749 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib64/libLLVM.so.22.1+0x563c749)
#1 0x00007f24c503c4d9 llvm::sys::CleanupOnSignal(unsigned long) (/lib64/libLLVM.so.22.1+0x563c4d9)
#2 0x00007f24c4fb6d55 (/lib64/libLLVM.so.22.1+0x55b6d55)
#3 0x00007f24c4fb6f66 (/lib64/libLLVM.so.22.1+0x55b6f66)
#4 0x00007f24bf41f5b0 __restore_rt (/lib64/libc.so.6+0x1a5b0)
#5 0x00007f24caecc477 clang::Sema::isUsableModule(clang::Module const*) (/lib64/libclang-cpp.so.22.1+0x28cc477)
#6 0x00007f24caecc634 clang::Sema::isModuleVisible(clang::Module const*, bool) (/lib64/libclang-cpp.so.22.1+0x28cc634)
#7 0x00007f24caecd448 clang::LookupResult::isAcceptableSlow(clang::Sema&, clang::NamedDecl*, clang::Sema::AcceptableKind) (/lib64/libclang-cpp.so.22.1+0x28cd448)
#8 0x00007f24caecdc0d clang::LookupResult::isAvailableForLookup(clang::Sema&, clang::NamedDecl*) (/lib64/libclang-cpp.so.22.1+0x28cdc0d)
#9 0x00007f24caecdb6a (/lib64/libclang-cpp.so.22.1+0x28cdb6a)
#10 0x00007f24caecdac3 clang::LookupResult::getAcceptableDeclSlow(clang::NamedDecl*) const (/lib64/libclang-cpp.so.22.1+0x28cdac3)
#11 0x00007f24c9a495c6 clang::Sema::LookupName(clang::LookupResult&, clang::Scope*, bool, bool) (/lib64/libclang-cpp.so.22.1+0x14495c6)
#12 0x00007f24c9a1d979 clang::Sema::ActOnCXXNestedNameSpecifier(clang::Scope*, clang::Sema::NestedNameSpecInfo&, bool, clang::CXXScopeSpec&, bool*, bool) (/lib64/libclang-cpp.so.22.1+0x141d979)
#13 0x00007f24c99e710d clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&, clang::OpaquePtr<clang::QualType>, bool, bool, bool*, bool, clang::IdentifierInfo const**, bool, bool, bool) (/lib64/libclang-cpp.so.22.1+0x13e710d)
#14 0x00007f24c99e02b7 clang::Parser::TryAnnotateTypeOrScopeToken(clang::ImplicitTypenameContext) (/lib64/libclang-cpp.so.22.1+0x13e02b7)
#15 0x00007f24c99da690 clang::Parser::isCXXDeclarationSpecifier(clang::ImplicitTypenameContext, clang::Parser::TPResult, bool*) (/lib64/libclang-cpp.so.22.1+0x13da690)
#16 0x00007f24c98f32ea clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/lib64/libclang-cpp.so.22.1+0x12f32ea)
#17 0x00007f24c9a80302 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/lib64/libclang-cpp.so.22.1+0x1480302)
#18 0x00007f24c9b7fbab clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/lib64/libclang-cpp.so.22.1+0x157fbab)
#19 0x00007f24c9fe1f5b clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/lib64/libclang-cpp.so.22.1+0x19e1f5b)
#20 0x00007f24c9957376 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/lib64/libclang-cpp.so.22.1+0x1357376)
#21 0x00007f24c99518f8 clang::Parser::ParseLinkage(clang::ParsingDeclSpec&, clang::DeclaratorContext) (/lib64/libclang-cpp.so.22.1+0x13518f8)
#22 0x00007f24c9956e86 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/lib64/libclang-cpp.so.22.1+0x1356e86)
#23 0x00007f24c995394c clang::ParseAST(clang::Sema&, bool, bool) (/lib64/libclang-cpp.so.22.1+0x135394c)
#24 0x00007f24ca2e7d7f clang::FrontendAction::Execute() (/lib64/libclang-cpp.so.22.1+0x1ce7d7f)
#25 0x00007f24ca2e798a clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib64/libclang-cpp.so.22.1+0x1ce798a)
#26 0x00007f24ca2e760e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib64/libclang-cpp.so.22.1+0x1ce760e)
#27 0x00005615a214018a cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-22+0xf18a)
#28 0x00005615a213f596 (/usr/bin/clang-22+0xe596)
#29 0x00005615a213f45c (/usr/bin/clang-22+0xe45c)
#30 0x00007f24cb61cf6d (/lib64/libclang-cpp.so.22.1+0x301cf6d)
#31 0x00007f24c4fb6cf0 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/lib64/libLLVM.so.22.1+0x55b6cf0)
#32 0x00007f24ca3b6f5f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/lib64/libclang-cpp.so.22.1+0x1db6f5f)
#33 0x00007f24ca25740f clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/lib64/libclang-cpp.so.22.1+0x1c5740f)
#34 0x00007f24ca257232 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/lib64/libclang-cpp.so.22.1+0x1c57232)
#35 0x00007f24ca256e68 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/lib64/libclang-cpp.so.22.1+0x1c56e68)
#36 0x00005615a2141ee8 clang_main(int, char**, llvm::ToolContext const&) (/usr/bin/clang-22+0x10ee8)
#37 0x00005615a2141399 main (/usr/bin/clang-22+0x10399)
#38 0x00007f24bf408681 __libc_start_call_main (/lib64/libc.so.6+0x3681)
#39 0x00007f24bf408798 __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3798)
#40 0x00005615a21484c5 _start (/usr/bin/clang-22+0x174c5)
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 22.1.4 (Fedora 22.1.4-1.fc44)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Configuration file: /etc/clang/x86_64-redhat-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: /tmp/main-80ce7d.cppm
clang++: note: diagnostic msg: /tmp/main-80ce7d.sh
clang++: note: diagnostic msg:
********************
hi, my compiler crashed on me as i was building a tiny modules project. it seems like a regression but i'm honestly a little confused because the project is almost 1:1 to another project of mine where this issue didn't occur. requested files attached below, i've also included the entire project i was building, it's just a couple of files:
main-80ce7d.tar.gz
rascal_cpp.tar.gz
.