[llvm-bugs] [Bug 46837] New: RecoveryExpr: Invalid header causes an assertion evaluating bool condition in 'if' "missing lvalue-to-rvalue conv in bool condition"

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 24 10:18:33 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46837

            Bug ID: 46837
           Summary: RecoveryExpr: Invalid header causes an assertion
                    evaluating bool condition in 'if' "missing
                    lvalue-to-rvalue conv in bool condition"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: erich.keane at intel.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

So, interesting reproducer:


#include <notfound>
template <typename a> constexpr bool b(a);
constexpr void d() {
  if (b(1))
    return ;
}

./bin/clang -cc1 file.cpp 


2.      preproc_crash.cpp:4:20: parsing function body 'd'
 #0 0x0000000004baee78 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/iusers/ekeane1/workspaces/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:22
 #1 0x0000000004baef0b PrintStackTraceSignalHandler(void*)
/iusers/ekeane1/workspaces/llvm-project/llvm/lib/Support/Unix/Signals.inc:625:1
 #2 0x0000000004bacf9d llvm::sys::RunSignalHandlers()
/iusers/ekeane1/workspaces/llvm-project/llvm/lib/Support/Signals.cpp:68:20
 #3 0x0000000004bae8bb SignalHandler(int)
/iusers/ekeane1/workspaces/llvm-project/llvm/lib/Support/Unix/Signals.inc:406:1
 #4 0x00007fe8c8e8b5e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0)
 #5 0x00007fe8c7a041f7 raise (/lib64/libc.so.6+0x351f7)
 #6 0x00007fe8c7a058e8 abort (/lib64/libc.so.6+0x368e8)
 #7 0x00007fe8c79fd266 __assert_fail_base (/lib64/libc.so.6+0x2e266)
 #8 0x00007fe8c79fd312 (/lib64/libc.so.6+0x2e312)
 #9 0x0000000008c2c56c EvaluateAsBooleanCondition(clang::Expr const*, bool&,
(anonymous namespace)::EvalInfo&)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/AST/ExprConstant.cpp:2372:3
#10 0x0000000008c347dd EvaluateCond((anonymous namespace)::EvalInfo&,
clang::VarDecl const*, clang::Expr const*, bool&)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/AST/ExprConstant.cpp:4617:7
#11 0x0000000008c35a15 EvaluateStmt((anonymous namespace)::StmtResult&,
(anonymous namespace)::EvalInfo&, clang::Stmt const*, clang::SwitchCase const*)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/AST/ExprConstant.cpp:4944:9
#12 0x0000000008c35850 EvaluateStmt((anonymous namespace)::StmtResult&,
(anonymous namespace)::EvalInfo&, clang::Stmt const*, clang::SwitchCase const*)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/AST/ExprConstant.cpp:4916:40
#13 0x0000000008c393d3 HandleFunctionCall(clang::SourceLocation,
clang::FunctionDecl const*, (anonymous namespace)::LValue const*,
llvm::ArrayRef<clang::Expr const*>, clang::Stmt const*, (anonymous
namespace)::EvalInfo&, clang::APValue&, (anonymous namespace)::LValue const*)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/AST/ExprConstant.cpp:5823:36
#14 0x0000000008c5f3f8 clang::Expr::isPotentialConstantExpr(clang::FunctionDecl
const*, llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/AST/ExprConstant.cpp:15092:23
#15 0x0000000007bc123a CheckConstexprFunctionBody(clang::Sema&,
clang::FunctionDecl const*, clang::Stmt*, clang::Sema::CheckConstexprKind)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp:2315:7
#16 0x0000000007bbf283
clang::Sema::CheckConstexprFunctionDefinition(clang::FunctionDecl const*,
clang::Sema::CheckConstexprKind)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp:1774:61
#17 0x0000000007aec91a clang::Sema::ActOnFinishFunctionBody(clang::Decl*,
clang::Stmt*, bool)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Sema/SemaDecl.cpp:14466:9
#18 0x0000000007aeacf5 clang::Sema::ActOnFinishFunctionBody(clang::Decl*,
clang::Stmt*)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Sema/SemaDecl.cpp:14119:1
#19 0x00000000078d0308 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Parse/ParseStmt.cpp:2246:41
#20 0x0000000007801015
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Parse/Parser.cpp:1339:36
#21 0x000000000781d402 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Parse/ParseDecl.cpp:1924:50
#22 0x000000000780003a
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Parse/Parser.cpp:1100:1
#23 0x00000000078000f4
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Parse/Parser.cpp:1115:57
#24 0x00000000077ff5d6
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (.localalias.1)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Parse/Parser.cpp:935:58
#25 0x00000000077fe705
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Parse/Parser.cpp:683:42
#26 0x00000000077fa307 clang::ParseAST(clang::Sema&, bool, bool)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Parse/ParseAST.cpp:158:37
#27 0x00000000056eb70d clang::ASTFrontendAction::ExecuteAction()
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1057:11
#28 0x00000000056eb075 clang::FrontendAction::Execute()
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Frontend/FrontendAction.cpp:954:38
#29 0x0000000005685696
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:984:42
#30 0x0000000005861680
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/iusers/ekeane1/workspaces/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:278:38
#31 0x000000000217b176 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/iusers/ekeane1/workspaces/llvm-project/clang/tools/driver/cc1_main.cpp:240:40
#32 0x00000000021710e7 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
/iusers/ekeane1/workspaces/llvm-project/clang/tools/driver/driver.cpp:330:20
#33 0x00000000021717e8 main
/iusers/ekeane1/workspaces/llvm-project/clang/tools/driver/driver.cpp:407:26
#34 0x00007fe8c79f0c05 __libc_start_main (/lib64/libc.so.6+0x21c05)
#35 0x000000000216f989 _start (./bin/clang+0x216f989)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200724/c31c6479/attachment.html>


More information about the llvm-bugs mailing list