-
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 partycrash-on-validgenerated by fuzzer
Description
This testcase is generated by a fuzzer.
Compiler Explorer: https://godbolt.org/z/Mfb3s14Td
This valid code will crash on Clang Assertion Trunk. It seems that this goes back to clang-12:
template <class...> struct Tuple {
template <class _Up> Tuple(_Up);
};
template <int> using ElementType = int;
template <int... fields>
Tuple<ElementType<fields>...> Parser();
struct Helper { Helper(Tuple<>, Tuple<>); };
struct D : Helper {
D() : Helper(Parser<>, Parser<>) {}
};Stack dump:
clang++: /root/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:762: unsigned int {anonymous}::PackDeductionScope::addPacks(clang::TemplateArgument): Assertion `!Packs.empty() && "Pack expansion without unexpanded packs?"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-12.0.0/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-10.3.0 -fcolor-diagnostics -fno-crash-diagnostics <source>
1. <source>:9:36: current parser token '{'
2. <source>:8:1: parsing struct/union/class body 'D'
#0 0x000056e61da32001 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x3606001)
#1 0x000056e61da2fcb4 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x3603cb4)
#2 0x000056e61da2ff51 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x3603f51)
#3 0x000056e61d98e6a8 CrashRecoverySignalHandler(int) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x35626a8)
#4 0x000072d340442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#5 0x000072d3404969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#6 0x000072d340442476 raise (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#7 0x000072d3404287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#8 0x000072d34042871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#9 0x000072d340439e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#10 0x000056e62037ef85 (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5f52f85)
#11 0x000056e62037fa23 DeduceTemplateArguments(clang::Sema&, clang::TemplateParameterList*, clang::TemplateSpecializationType const*, clang::QualType, clang::sema::TemplateDeductionInfo&, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5f53a23)
#12 0x000056e62037bf06 DeduceTemplateArgumentsByTypeMatch(clang::Sema&, clang::TemplateParameterList*, clang::QualType, clang::QualType, clang::sema::TemplateDeductionInfo&, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, bool, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5f4ff06)
#13 0x000056e62037b3fa DeduceTemplateArgumentsByTypeMatch(clang::Sema&, clang::TemplateParameterList*, clang::QualType, clang::QualType, clang::sema::TemplateDeductionInfo&, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, bool, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5f4f3fa)
#14 0x000056e620382eb4 clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, clang::QualType, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5f56eb4)
#15 0x000056e6201f9a4f clang::Sema::ResolveAddressOfOverloadedFunction(clang::Expr*, clang::QualType, bool, clang::DeclAccessPair&, bool*) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5dcda4f)
#16 0x000056e6201fbb6a IsStandardConversion(clang::Sema&, clang::Expr*, clang::QualType, bool, clang::StandardConversionSequence&, bool, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5dcfb6a)
#17 0x000056e620207fb3 TryImplicitConversion(clang::Sema&, clang::Expr*, clang::QualType, bool, clang::Sema::AllowedExplicit, bool, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5ddbfb3)
#18 0x000056e620202364 TryCopyInitialization(clang::Sema&, clang::Expr*, clang::QualType, bool, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5dd6364)
#19 0x000056e62020429d clang::Sema::AddOverloadCandidate(clang::FunctionDecl*, clang::DeclAccessPair, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, bool, bool, clang::CallExpr::ADLCallKind, llvm::MutableArrayRef<clang::ImplicitConversionSequence>, clang::OverloadCandidateParamOrder) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5dd829d)
#20 0x000056e620204db0 clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*, clang::DeclAccessPair, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, bool, clang::CallExpr::ADLCallKind, clang::OverloadCandidateParamOrder) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5dd8db0)
#21 0x000056e6202076e6 IsUserDefinedConversion(clang::Sema&, clang::Expr*, clang::QualType, clang::UserDefinedConversionSequence&, clang::OverloadCandidateSet&, clang::Sema::AllowedExplicit, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5ddb6e6)
#22 0x000056e620207bc5 TryUserDefinedConversion(clang::Sema&, clang::Expr*, clang::QualType, bool, clang::Sema::AllowedExplicit, bool, bool, bool, bool) (.constprop.0) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5ddbbc5)
#23 0x000056e6202081e6 TryImplicitConversion(clang::Sema&, clang::Expr*, clang::QualType, bool, clang::Sema::AllowedExplicit, bool, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5ddc1e6)
#24 0x000056e620202364 TryCopyInitialization(clang::Sema&, clang::Expr*, clang::QualType, bool, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5dd6364)
#25 0x000056e62020429d clang::Sema::AddOverloadCandidate(clang::FunctionDecl*, clang::DeclAccessPair, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, bool, bool, clang::CallExpr::ADLCallKind, llvm::MutableArrayRef<clang::ImplicitConversionSequence>, clang::OverloadCandidateParamOrder) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5dd829d)
#26 0x000056e6200a191a ResolveConstructorOverload(clang::Sema&, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, clang::QualType, clang::DeclContextLookupResult, clang::OverloadCandidate*&, bool, bool, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5c7591a)
#27 0x000056e6200b2aa9 TryConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType, clang::QualType, clang::InitializationSequence&, bool, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5c86aa9)
#28 0x000056e6200b594d clang::InitializationSequence::InitializeFrom(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, bool, bool) (.localalias) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5c8994d)
#29 0x000056e61fe039b2 clang::Sema::BuildBaseInitializer(clang::QualType, clang::TypeSourceInfo*, clang::Expr*, clang::CXXRecordDecl*, clang::SourceLocation) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x59d79b2)
#30 0x000056e61fe03d2b clang::Sema::BuildMemInitializer(clang::Decl*, clang::Scope*, clang::CXXScopeSpec&, clang::IdentifierInfo*, clang::OpaquePtr<clang::QualType>, clang::DeclSpec const&, clang::SourceLocation, clang::Expr*, clang::SourceLocation) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x59d7d2b)
#31 0x000056e61faf3016 clang::Parser::ParseMemInitializer(clang::Decl*) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x56c7016)
#32 0x000056e61faf60fb clang::Parser::ParseConstructorInitializer(clang::Decl*) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x56ca0fb)
#33 0x000056e61fabe518 clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5692518)
#34 0x000056e61fabe04d clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x569204d)
#35 0x000056e61fb0209e clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int, clang::Decl*) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x56d609e)
#36 0x000056e61fb043d5 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::Parser::ParsedAttributesWithRange&) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x56d83d5)
#37 0x000056e61fadf9b5 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x56b39b5)
#38 0x000056e61fab4473 clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5688473)
#39 0x000056e61fab4d21 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.0) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5688d21)
#40 0x000056e61fabb210 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (.localalias) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x568f210)
#41 0x000056e61fabc158 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5690158)
#42 0x000056e61faaf319 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x5683319)
#43 0x000056e61eab7b28 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x468bb28)
#44 0x000056e61e3b10c9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x3f850c9)
#45 0x000056e61e35068e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x3f2468e)
#46 0x000056e61e4873c0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x405b3c0)
#47 0x000056e61b4f911d cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x10cd11d)
#48 0x000056e61b4f5818 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x10c9818)
#49 0x000056e61e1f5d29 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const::'lambda'()>(long) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x3dc9d29)
#50 0x000056e61d98e82c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x356282c)
#51 0x000056e61e1f68c7 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (.part.0) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x3dca8c7)
#52 0x000056e61e1c96db clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x3d9d6db)
#53 0x000056e61e1ca1f9 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x3d9e1f9)
#54 0x000056e61e1d50b9 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x3da90b9)
#55 0x000056e61b42e90d main (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x100290d)
#56 0x000072d340429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#57 0x000072d340429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#58 0x000056e61b4f536e _start (/opt/compiler-explorer/clang-assertions-12.0.0/bin/clang+++0x10c936e)
clang-12: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
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 partycrash-on-validgenerated by fuzzer