islvalue-fail.cpp:1:45: error: non-void function 'Fun' should return a value [-Wreturn-type] template constexpr T &Fun(T) { return; } ^ islvalue-fail.cpp:3:21: note: in instantiation of function template specialization 'Fun' requested here constexpr int Var = Fun(0) ^ clang-3.6: /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/AST/ExprConstant.cpp:938: void (anonymous namespace)::LValue::setFrom(clang::ASTContext &, const clang::APValue &): Assertion `V.isLValue()' failed. #0 0x7f49c8072130 llvm::sys::PrintStackTrace(_IO_FILE*) /home/sliedes/projects/llvm/llvm.src/lib/Support/Unix/Signals.inc:422:15 #1 0x7f49c8077ed3 SignalHandler(int) /home/sliedes/projects/llvm/llvm.src/lib/Support/Unix/Signals.inc:198:3 #2 0x7f49c5934180 (/lib/x86_64-linux-gnu/libc.so.6+0x35180) #3 0x7f49c5934107 gsignal /build/glibc-NmptCx/glibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0 #4 0x7f49c59354e8 abort /build/glibc-NmptCx/glibc-2.19/stdlib/abort.c:91:0 #5 0x7f49c592d226 __assert_fail_base /build/glibc-NmptCx/glibc-2.19/assert/assert.c:92:0 #6 0x7f49c592d2d2 (/lib/x86_64-linux-gnu/libc.so.6+0x2e2d2) #7 0x7f49c2b88f1f (/home/sliedes/local/llvm-trunk-rel/bin/../lib/../lib/libclangAST.so+0x53bf1f) #8 0x7f49c2ca50b4 (anonymous namespace)::LValueExprEvaluatorBase<(anonymous namespace)::LValueExprEvaluator>::Success(clang::APValue const&, clang::Expr const*) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/AST/ExprConstant.cpp:4325:5 #9 0x7f49c2ca50b4 (anonymous namespace)::ExprEvaluatorBase<(anonymous namespace)::LValueExprEvaluator>::DerivedSuccess(clang::APValue const&, clang::Expr const*) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/AST/ExprConstant.cpp:3895:0 #10 0x7f49c2ca50b4 (anonymous namespace)::ExprEvaluatorBase<(anonymous namespace)::LValueExprEvaluator>::VisitCallExpr(clang::CallExpr const*) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/AST/ExprConstant.cpp:4160:0 #11 0x7f49c2c94833 clang::StmtVisitorBase::Visit(clang::Stmt const*) /home/sliedes/scratch/build/llvm-rel-assert-afl.ninja/tools/clang/include/clang/AST/StmtNodes.inc:299:1 #12 0x7f49c2b6d64f EvaluateLValue(clang::Expr const*, (anonymous namespace)::LValue&, (anonymous namespace)::EvalInfo&) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/AST/ExprConstant.cpp:4491:10 #13 0x7f49c2bcedeb (anonymous namespace)::ExprEvaluatorBase<(anonymous namespace)::IntExprEvaluator>::VisitCastExpr(clang::CastExpr const*) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/AST/ExprConstant.cpp:4226:12 #14 0x7f49c2bcedeb (anonymous namespace)::IntExprEvaluator::VisitCastExpr(clang::CastExpr const*) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/AST/ExprConstant.cpp:7395:0 #15 0x7f49c2b98873 clang::StmtVisitorBase::VisitImplicitCastExpr(clang::ImplicitCastExpr const*) /home/sliedes/scratch/build/llvm-rel-assert-afl.ninja/tools/clang/include/clang/AST/StmtNodes.inc:393:1 #16 0x7f49c2b98873 clang::StmtVisitorBase::Visit(clang::Stmt const*) /home/sliedes/scratch/build/llvm-rel-assert-afl.ninja/tools/clang/include/clang/AST/StmtNodes.inc:393:0 #17 0x7f49c2b7bd60 Evaluate(clang::APValue&, (anonymous namespace)::EvalInfo&, clang::Expr const*) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/AST/ExprConstant.cpp:8313:10 #18 0x7f49c2b6ff36 EvaluateInPlace(clang::APValue&, (anonymous namespace)::EvalInfo&, (anonymous namespace)::LValue const&, clang::Expr const*, bool) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/AST/ExprConstant.cpp:8390:10 #19 0x7f49c2b6f26e clang::Expr::EvaluateAsInitializer(clang::APValue&, clang::ASTContext const&, clang::VarDecl const*, llvm::SmallVectorImpl >&) const /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/AST/ExprConstant.cpp:8524:8 #20 0x7f49c29d718e clang::VarDecl::evaluateValue(llvm::SmallVectorImpl >&) const /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/AST/Decl.cpp:2068:7 #21 0x7f49c09ff9b9 clang::Sema::CheckCompleteVariableDeclaration(clang::VarDecl*) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/Sema/SemaDecl.cpp:9510:12 #22 0x7f49c09f941b clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool, bool) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/Sema/SemaDecl.cpp:9037:3 #23 0x7f49c1c182a8 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/Parse/ParseDecl.cpp:1933:9 #24 0x7f49c1c0ec69 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/Parse/ParseDecl.cpp:1698:21 #25 0x7f49c1de60e0 clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/Parse/Parser.cpp:893:10 #26 0x7f49c1de46ba clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/Parse/Parser.cpp:909:12 #27 0x7f49c1de192b clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/Parse/Parser.cpp:637:12 #28 0x7f49c1dde431 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr&) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/Parse/Parser.cpp:569:12 #29 0x7f49c1bc4c93 clang::ParseAST(clang::Sema&, bool, bool) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/Parse/ParseAST.cpp:145:15 #30 0x7f49c6912b81 clang::FrontendAction::Execute() /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/Frontend/FrontendAction.cpp:428:8 #31 0x7f49c6865488 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/Frontend/CompilerInstance.cpp:804:7 #32 0x7f49c64cf2c3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:222:18 #33 0x420258 cc1_main(llvm::ArrayRef, char const*, void*) /home/sliedes/projects/llvm/llvm.src/tools/clang/tools/driver/cc1_main.cpp:110:13 #34 0x419925 ExecuteCC1Tool(llvm::ArrayRef, llvm::StringRef) /home/sliedes/projects/llvm/llvm.src/tools/clang/tools/driver/driver.cpp:369:12 #35 0x419925 main /home/sliedes/projects/llvm/llvm.src/tools/clang/tools/driver/driver.cpp:415:0 #36 0x7f49c5920b45 __libc_start_main /build/glibc-NmptCx/glibc-2.19/csu/libc-start.c:321:0 #37 0x40b328 _start (/home/sliedes/local/llvm-trunk-rel/bin/clang-3.6+0x40b328) Stack dump: 0. Program arguments: /home/sliedes/local/llvm-trunk-rel/bin/clang-3.6 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name islvalue-fail.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 -resource-dir /home/sliedes/local/llvm-trunk-rel/bin/../lib/clang/3.6.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/backward -internal-isystem /usr/local/include -internal-isystem /home/sliedes/local/llvm-trunk-rel/bin/../lib/clang/3.6.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/sliedes/t/clang/bug/min -ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o /tmp/islvalue-fail-19dfa2.o -x c++ islvalue-fail.cpp 1. parser at end of file clang-3.6: error: unable to execute command: Aborted clang-3.6: error: clang frontend command failed due to signal (use -v to see invocation)