https://llvm.org/bugs/show_bug.cgi?id=25029
Bug ID: 25029 Summary: Regression: Assert static clang::DependentScopeDeclRefExpr* clang::DependentScopeDeclRefExpr::Create(const clang::ASTContext&, clang::NestedNameSpecifierLoc, clang::SourceLocation, const clang::DeclarationNameInfo&, const clang::TemplateArgumentListInfo*) Product: clang Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: C++11 Assignee: unassignedclangb...@nondot.org Reporter: andrey....@gmail.com CC: dgre...@apple.com, llvm-bugs@lists.llvm.org Classification: Unclassified The following code works as expected in 3.6 but ICEs with assertion failure in 3.8: // begin bbc6.cc struct A { template <class T> static T f(T) { return T(); } }; template <class T> struct C { decltype(operator T (A::f(T))) t; int f(); }; // end bbc6.cc Expected output (Clang 3.6): /tmp/bbc6.cc:8:28: error: 'T' does not refer to a value decltype(operator T (A::f(T))) t; ^ /tmp/bbc6.cc:6:17: note: declared here template <class T> ^ 1 error generated. Actual output (Clang 3.8): x86_64-pc-linux-gnu-clang-3.8: /var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999/tools/clang/lib/AST/ExprCXX.cpp:451: static clang::DependentScopeDeclRefExpr* clang::DependentScopeDeclRefExpr::Create(const clang::ASTContext&, clang::NestedNameSpecifierLoc, clang::SourceLocation, const clang::DeclarationNameInfo&, const clang::TemplateArgumentListInfo*): Assertion `QualifierLoc && "should be created for dependent qualifiers"' failed. #0 0x7fab789ec0f7 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/bin/../lib64/libLLVMSupport.so.3.8+0xcb0f7) #1 0x7fab789eb0b6 llvm::sys::RunSignalHandlers() (/usr/bin/../lib64/libLLVMSupport.so.3.8+0xca0b6) #2 0x7fab789eb52f SignalHandler(int) (/usr/bin/../lib64/libLLVMSupport.so.3.8+0xca52f) #3 0x7fab76746440 __restore_rt (/lib64/libc.so.6+0x33440) #4 0x7fab767463c7 __GI_raise (/lib64/libc.so.6+0x333c7) #5 0x7fab7674775a __GI_abort (/lib64/libc.so.6+0x3475a) #6 0x7fab7673f3ad __assert_fail_base (/lib64/libc.so.6+0x2c3ad) #7 0x7fab7673f462 (/lib64/libc.so.6+0x2c462) #8 0x7fab73a10fa5 (/usr/bin/../lib64/../lib64/libclangAST.so.3.8+0x1fcfa5) #9 0x7fab726f7e65 clang::Sema::BuildDependentDeclRefExpr(clang::CXXScopeSpec const&, clang::SourceLocation, clang::DeclarationNameInfo const&, clang::TemplateArgumentListInfo const*) (/usr/bin/../lib64/../lib64/libclangSema.so.3.8+0x42ae65) #10 0x7fab726f7ee5 clang::Sema::ActOnDependentIdExpression(clang::CXXScopeSpec const&, clang::SourceLocation, clang::DeclarationNameInfo const&, bool, clang::TemplateArgumentListInfo const*) (/usr/bin/../lib64/../lib64/libclangSema.so.3.8+0x42aee5) #11 0x7fab72566b06 clang::Sema::ActOnIdExpression(clang::Scope*, clang::CXXScopeSpec&, clang::SourceLocation, clang::UnqualifiedId&, bool, bool, std::unique_ptr<clang::CorrectionCandidateCallback, std::default_delete<clang::CorrectionCandidateCallback> >, bool, clang::Token*) (/usr/bin/../lib64/../lib64/libclangSema.so.3.8+0x299b06) #12 0x7fab72c84dd5 clang::Parser::tryParseCXXIdExpression(clang::CXXScopeSpec&, bool, clang::Token&) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x78dd5) #13 0x7fab72c84f10 clang::Parser::ParseCXXIdExpression(bool) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x78f10) #14 0x7fab72c6f0b7 clang::Parser::ParseCastExpression(bool, bool, bool&, clang::Parser::TypeCastState) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x630b7) #15 0x7fab72c7199d clang::Parser::ParseCastExpression(bool, bool, clang::Parser::TypeCastState) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x6599d) #16 0x7fab72c71a2f clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x65a2f) #17 0x7fab72c71aa9 clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x65aa9) #18 0x7fab72c5d7b3 clang::Parser::ParseDecltypeSpecifier(clang::DeclSpec&) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x517b3) #19 0x7fab72c8394f clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&, clang::OpaquePtr<clang::QualType>, bool, bool*, bool, clang::IdentifierInfo**) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x7794f) #20 0x7fab72cc70aa clang::Parser::TryAnnotateCXXScopeToken(bool) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0xbb0aa) #21 0x7fab72c50e6b clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x44e6b) #22 0x7fab72c65710 clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier, clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject*) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x59710) #23 0x7fab72c679ed clang::Parser::ParseCXXClassMemberDeclarationWithPragmas(clang::AccessSpecifier&, clang::Parser::ParsedAttributesWithRange&, clang::TypeSpecifierType, clang::Decl*) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x5b9ed) #24 0x7fab72c69d20 clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int, clang::Decl*) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x5dd20) #25 0x7fab72c6b033 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::Parser::ParsedAttributesWithRange&) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x5f033) #26 0x7fab72c50718 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x44718) #27 0x7fab72cbd625 clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0xb1625) #28 0x7fab72cbf236 clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0xb3236) #29 0x7fab72cbf611 clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0xb3611) #30 0x7fab72c5a2ac clang::Parser::ParseDeclaration(unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x4e2ac) #31 0x7fab72ccc2d0 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0xc02d0) #32 0x7fab72cccb12 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0xc0b12) #33 0x7fab72c3707b clang::ParseAST(clang::Sema&, bool, bool) (/usr/bin/../lib64/../lib64/libclangParse.so.3.8+0x2b07b) #34 0x7fab77acbf28 clang::CodeGenAction::ExecuteAction() (/usr/bin/../lib64/libclangCodeGen.so.3.8+0x20cf28) #35 0x7fab773001f6 clang::FrontendAction::Execute() (/usr/bin/../lib64/libclangFrontend.so.3.8+0xb01f6) #36 0x7fab772cfcb9 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/bin/../lib64/libclangFrontend.so.3.8+0x7fcb9) #37 0x7fab7704cbe4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/bin/../lib64/libclangFrontendTool.so.3.8+0x2be4) #38 0x40ff48 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/x86_64-pc-linux-gnu-clang-3.8+0x40ff48) #39 0x40a72b main (/usr/bin/x86_64-pc-linux-gnu-clang-3.8+0x40a72b) #40 0x7fab767337b0 __libc_start_main (/lib64/libc.so.6+0x207b0) #41 0x40c859 _start (/usr/bin/x86_64-pc-linux-gnu-clang-3.8+0x40c859) Stack dump: 0. Program arguments: /usr/bin/x86_64-pc-linux-gnu-clang-3.8 -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name bbc6.cc -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -coverage-file /tmp/bbc6.cc -resource-dir /usr/bin/../lib/clang/3.8.0 -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/include/g++-v5 -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/include/g++-v5/x86_64-pc-linux-gnu -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/include/g++-v5/backward -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.8.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 139 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o bbc6.o -x c++ /tmp/bbc6.cc 1. /tmp/bbc6.cc:8:22: current parser token '(' 2. /tmp/bbc6.cc:7:1: parsing struct/union/class body 'C' x86_64-pc-linux-gnu-clang-3.8: error: unable to execute command: Aborted x86_64-pc-linux-gnu-clang-3.8: error: clang frontend command failed due to signal (use -v to see invocation) clang version 3.8.0 (757da432107d7c06a337f0984acf60d4bccec08d) (7df74560640c58b524620fc11eb740cac685ba13) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin x86_64-pc-linux-gnu-clang-3.8: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script. x86_64-pc-linux-gnu-clang-3.8: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: x86_64-pc-linux-gnu-clang-3.8: note: diagnostic msg: /tmp/bbc6-b15335.cpp x86_64-pc-linux-gnu-clang-3.8: note: diagnostic msg: /tmp/bbc6-b15335.sh x86_64-pc-linux-gnu-clang-3.8: note: diagnostic msg: clang++ -v: clang version 3.8.0 (757da432107d7c06a337f0984acf60d4bccec08d) (7df74560640c58b524620fc11eb740cac685ba13) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0 // begin bbc6-b15335.sh # Crash reproducer for clang version 3.8.0 (757da432107d7c06a337f0984acf60d4bccec08d) (7df74560640c58b524620fc11eb740cac685ba13) # Driver args: "--driver-mode=g++" "-c" "-std=c++11" "/tmp/bbc6.cc" # Original command: "/usr/bin/x86_64-pc-linux-gnu-clang-3.8" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free" "-main-file-name" "bbc6.cc" "-mrelocation-model" "static" "-mthread-model" "posix" "-mdisable-fp-elim" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-fuse-init-array" "-target-cpu" "x86-64" "-dwarf-column-info" "-coverage-file" "/tmp/bbc6.cc" "-resource-dir" "/usr/bin/../lib/clang/3.8.0" "-internal-isystem" "/usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/include/g++-v5" "-internal-isystem" "/usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/include/g++-v5/x86_64-pc-linux-gnu" "-internal-isystem" "/usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/include/g++-v5/backward" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/usr/bin/../lib/clang/3.8.0/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-std=c++11" "-fdeprecated-macro" "-fdebug-compilation-dir" "/tmp" "-ferror-limit" "19" "-fmessage-length" "139" "-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-o" "bbc6.o" "-x" "c++" "/tmp/bbc6.cc" "/usr/bin/x86_64-pc-linux-gnu-clang-3.8" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free" "-main-file-name" "bbc6.cc" "-mrelocation-model" "static" "-mthread-model" "posix" "-mdisable-fp-elim" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-fuse-init-array" "-target-cpu" "x86-64" "-dwarf-column-info" "-std=c++11" "-fdeprecated-macro" "-ferror-limit" "19" "-fmessage-length" "139" "-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-x" "c++" "bbc6-b15335.cpp" // end bbc6-b15335.sh -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs