Open chengniansun opened 3 years ago
Assertions build is still crashing: https://godbolt.org/z/hP74EGdx9 Diagnostics:
<source>:1:43: error: use of undeclared identifier 'VariableWithParentheses'
1 | extern int b __attribute__((alias("a"))) (VariableWithParentheses);
| ^
<source>:1:12: warning: 'extern' variable has an initializer [-Wextern-initializer]
1 | extern int b __attribute__((alias("a"))) (VariableWithParentheses);
| ^
Assertion:
clang: /root/llvm-project/clang/lib/Sema/SemaDecl.cpp:6950: void checkAttributesAfterMerging(clang::Sema&, clang::NamedDecl&): Assertion `VD->isThisDeclarationADefinition() && !VD->isExternallyVisible() && "Broken AliasAttr handled late!"' failed.
Stack:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0 -fcolor-diagnostics -fno-crash-diagnostics <source>
1. <source>:1:67: current parser token ';'
#0 0x00005572f9cc1dbf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c12dbf)
#1 0x00005572f9cbfb2c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c10b2c)
#2 0x00005572f9c091a8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f22e53a9420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f22e4e7600b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#5 0x00007f22e4e55859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x00007f22e4e55729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#7 0x00007f22e4e66fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#8 0x00005572fc75912a checkAttributesAfterMerging(clang::Sema&, clang::NamedDecl&) SemaDecl.cpp:0:0
#9 0x00005572fc761915 clang::Sema::FinalizeDeclaration(clang::Decl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x66b2915)
#10 0x00005572fc4357b2 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63867b2)
#11 0x00005572fc442d98 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6393d98)
#12 0x00005572fc40fcc1 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6360cc1)
#13 0x00005572fc41057f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.0) Parser.cpp:0:0
#14 0x00005572fc416f21 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6367f21)
#15 0x00005572fc417896 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6368896)
#16 0x00005572fc417d34 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6368d34)
#17 0x00005572fc40b62a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x635c62a)
#18 0x00005572faf0f7c8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4e607c8)
#19 0x00005572fa766f09 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x46b7f09)
#20 0x00005572fa6eb3d6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x463c3d6)
#21 0x00005572fa8499e6 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x479a9e6)
#22 0x00005572f717d46d cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10ce46d)
#23 0x00005572f717916a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#24 0x00005572fa55339d void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#25 0x00005572f9c096b0 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3b5a6b0)
#26 0x00005572fa5539bf clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#27 0x00005572fa51b0ec clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x446c0ec)
#28 0x00005572fa51bb7d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x446cb7d)
#29 0x00005572fa523c5d clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4474c5d)
#30 0x00005572f717b6ca clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10cc6ca)
#31 0x00005572f7082235 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xfd3235)
#32 0x00007f22e4e57083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#33 0x00005572f7173f4e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10c4f4e)
@llvm/issue-subscribers-clang-frontend
Extended Description
$ clang-trunk -v
$ cat mutant.c
$ clang-trunk mutant.c