https://llvm.org/bugs/show_bug.cgi?id=31584
Bug ID: 31584 Summary: clang crash in clang::Expr::EvaluateAsInitializer Product: new-bugs Version: unspecified Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: yaron.ke...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified $ cat file2.cpp template <class f> void f : g() { f coordinates const bool e(coordinates); } $ clang -c file2.cpp file2.cpp:1:27: error: unexpected ':' in nested name specifier; did you mean '::'? template <class f> void f : g() { f coordinates const bool e(coordinates); } ^ :: file2.cpp:1:29: error: nested name specifier 'f::' for declaration does not refer into a class, class template or class template partial specialization template <class f> void f : g() { f coordinates const bool e(coordinates); } ~~~ ^ file2.cpp:1:48: error: expected ';' at end of declaration template <class f> void f : g() { f coordinates const bool e(coordinates); } ^ ; #0 0x0000000001724335 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/local/bin/clang-4.0+0x1724335) #1 0x0000000001724986 SignalHandler(int) (/usr/local/bin/clang-4.0+0x1724986) #2 0x00007f0d5153d390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390) #3 0x0000000002c38a7c clang::Expr::EvaluateAsInitializer(clang::APValue&, clang::ASTContext const&, clang::VarDecl const*, llvm::SmallVectorImpl<std::pair<clang::SourceLocation, clang::PartialDiagnostic> >&) const (/usr/local/bin/clang-4.0+0x2c38a7c) #4 0x0000000002be9e94 clang::VarDecl::evaluateValue(llvm::SmallVectorImpl<std::pair<clang::SourceLocation, clang::PartialDiagnostic> >&) const (/usr/local/bin/clang-4.0+0x2be9e94) #5 0x0000000002be9e20 clang::VarDecl::evaluateValue() const (/usr/local/bin/clang-4.0+0x2be9e20) #6 0x0000000002b5bfa6 clang::ASTContext::DeclMustBeEmitted(clang::Decl const*) (/usr/local/bin/clang-4.0+0x2b5bfa6) #7 0x00000000024d5c72 clang::Sema::CheckCompleteVariableDeclaration(clang::VarDecl*) (/usr/local/bin/clang-4.0+0x24d5c72) #8 0x00000000024d490e clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool, bool) (/usr/local/bin/clang-4.0+0x24d490e) #9 0x0000000002221d66 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/usr/local/bin/clang-4.0+0x2221d66) #10 0x000000000221ff7e clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/usr/local/bin/clang-4.0+0x221ff7e) #11 0x000000000221c7da clang::Parser::ParseSimpleDeclaration(unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool, clang::Parser::ForRangeInit*) (/usr/local/bin/clang-4.0+0x221c7da) #12 0x000000000221c3a7 clang::Parser::ParseDeclaration(unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) (/usr/local/bin/clang-4.0+0x221c3a7) #13 0x000000000227e343 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) (/usr/local/bin/clang-4.0+0x227e343) #14 0x000000000227df69 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*) (/usr/local/bin/clang-4.0+0x227df69) #15 0x000000000228449a clang::Parser::ParseCompoundStatementBody(bool) (/usr/local/bin/clang-4.0+0x228449a) #16 0x0000000002284db6 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/usr/local/bin/clang-4.0+0x2284db6) #17 0x000000000220cca4 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/usr/local/bin/clang-4.0+0x220cca4) #18 0x000000000228b61e clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) (/usr/local/bin/clang-4.0+0x228b61e) #19 0x000000000228a3bb clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) (/usr/local/bin/clang-4.0+0x228a3bb) #20 0x0000000002289dc6 clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) (/usr/local/bin/clang-4.0+0x2289dc6) #21 0x000000000221c2a9 clang::Parser::ParseDeclaration(unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) (/usr/local/bin/clang-4.0+0x221c2a9) #22 0x000000000220a566 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/usr/local/bin/clang-4.0+0x220a566) #23 0x000000000220a1b7 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) (/usr/local/bin/clang-4.0+0x220a1b7) #24 0x0000000002209c19 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) (/usr/local/bin/clang-4.0+0x2209c19) #25 0x0000000002206ab5 clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/bin/clang-4.0+0x2206ab5) #26 0x0000000001b8a42f clang::FrontendAction::Execute() (/usr/local/bin/clang-4.0+0x1b8a42f) #27 0x0000000001b54828 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/local/bin/clang-4.0+0x1b54828) #28 0x0000000001c022d3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/local/bin/clang-4.0+0x1c022d3) #29 0x00000000007fd70b cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/local/bin/clang-4.0+0x7fd70b) #30 0x00000000007fc184 main (/usr/local/bin/clang-4.0+0x7fc184) #31 0x00007f0d5008c830 __libc_start_main /build/glibc-t3gR2i/glibc-2.23/csu/../csu/libc-start.c:325:0 #32 0x00000000007f9649 _start (/usr/local/bin/clang-4.0+0x7f9649) Stack dump: 0. Program arguments: /usr/local/bin/clang-4.0 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name file2.cpp -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 -debugger-tuning=gdb -coverage-notes-file /home/ceemple/bug/1679/file2.gcno -resource-dir /usr/local/bin/../lib/clang/4.0.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/x86_64-linux-gnu/c++/6.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/x86_64-linux-gnu/c++/6.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/local/bin/../lib/clang/4.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fmessage-length 136 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o file2.o -x c++ file2.cpp 1. file2.cpp:1:74: current parser token ';' 2. file2.cpp:1:33: parsing function body 3. file2.cpp:1:33: in compound statement ('{}') clang-4.0: error: unable to execute command: Segmentation fault (core dumped) clang-4.0: error: clang frontend command failed due to signal (use -v to see invocation) clang version 4.0.0 (trunk 291267) -- 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