Open 17789289 opened 3 months ago
Could you please provide version information, complete crash stack and reproducer, preferably on https://godbolt.org?
Below is my code,it's very simple:
int main() { std::cout << "Hello world!" << std::endl; return 0; }
the issue was occurred at WSL Ubuntu 24.04 LTS platform with Clang 18.1.8
what I have done so far: just run the same code and command (clang hello.cpp -o hello -lstdc++ -ccc-print-phases) in WSL Ubuntu 22.04 LTS platform with clang14, no issue found in the result. But when I run the same command using clang17 and clang18.1.8, same issue raised:
clang hello.cpp -o hello -lstdc++ -ccc-print-phases +- 0: input, "hello.cpp", c++ +- 1: preprocessor, {0}, c++-cpp-output +- 2: compiler, {1}, ir +- 3: backend, {2}, assembler +- 4: assembler, {3}, object clang: /home/qiwei/llvm-project/llvm/include/llvm/ADT/SmallVector.h:308: llvm::SmallVectorTemplateCommon::const_reference llvm::SmallVectorTemplateCommon<const char >::operator const [T = const char ]: Assertion `idx < size()' 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:
Aborted
@llvm/issue-subscribers-clang-driver
Author: Dynpro (17789289)
using command : clang hello.cpp -o hello -lstdc++ is OK, but:
clang hello.cpp -o hello -lstdc++ -ccc-print-phases +- 0: input, "hello.cpp", c++ +- 1: preprocessor, {0}, c++-cpp-output +- 2: compiler, {1}, ir +- 3: backend, {2}, assembler +- 4: assembler, {3}, object clang: /home/qiwei/llvm-project/llvm/include/llvm/ADT/SmallVector.h:308: const_reference llvm::SmallVectorTemplateCommon<const char >::operator const [T = const char ]: Assertion `idx < size()' failed.