[llvm-bugs] [Bug 44928] New: Assertion `Result.isInvalid() && "C++ binary operator overloading is missing candidates!"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Feb 15 11:27:40 PST 2020


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

            Bug ID: 44928
           Summary: Assertion `Result.isInvalid() && "C++ binary operator
                    overloading is missing candidates!"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: changochen1 at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

POC:
---
enum {} a {
  a += ""
---

Run script:
---
# Crash reproducer for clang version 11.0.0
(https://github.com/llvm/llvm-project.git
56b7f595d2b402ff177ca42214325c8fdea10fb0)
# Driver args: "--driver-mode=g++" "-x" "c++" "-o" "tm" "./test1.c"
# Original command:  "/data/rxz226/llvm-project/bld/bin/clang-11" "-cc1"
"-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-resource-dir"
"/data/rxz226/llvm-project/bld/lib/clang/11.0.0" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0"
"-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/x86_64-linux-gnu/c++/7.4.0"
"-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/x86_64-linux-gnu/c++/7.4.0"
"-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/backward"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/data/rxz226/llvm-project/bld/lib/clang/11.0.0/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-fdeprecated-macro" "-fdebug-compilation-dir"
"/home/rxz226/c_reduce" "-ferror-limit" "19" "-fmessage-length" "0"
"-fgnuc-version=4.2.1" "-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-faddrsig" "-o"
"/tmp/test1-ccaca2.o" "-x" "c++" "./test1.c"
 "/data/rxz226/llvm-project/bld/bin/clang-11" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-fdeprecated-macro" "-ferror-limit" "19"
"-fmessage-length" "0" "-fgnuc-version=4.2.1" "-fobjc-runtime=gcc"
"-fcxx-exceptions" "-fexceptions" "-fdiagnostics-show-option"
"-fcolor-diagnostics" "-faddrsig" "-x" "c++" "test1-e7d559.cpp"
---

Stack dump:
---
clang++: /home/rxz226/llvm-project/clang/lib/Sema/SemaOverload.cpp:13450:
clang::ExprResult clang::Sema::CreateOverloadedBinOp(clang::SourceLocation,
clang::BinaryOperatorKind, const clang::UnresolvedSetImpl&, clang::Expr*, clan
g::Expr*, bool, bool, clang::FunctionDecl*): Assertion `Result.isInvalid() &&
"C++ binary operator overloading is missing candidates!"' failed.
Stack dump:
0.      Program arguments: /home/rxz226/llvm-project/bld/bin/clang++ -x c++ -o
tm ./test1.c
1.      <eof> parser at end of file
 #0 0x000000000511679b llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:0
 #1 0x000000000511682e PrintStackTraceSignalHandler(void*)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:625:0
 #2 0x00000000051145b6 llvm::sys::RunSignalHandlers()
/home/rxz226/llvm-project/llvm/lib/Support/Signals.cpp:68:0
 #3 0x0000000005115fd7 llvm::sys::CleanupOnSignal(unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:361:0
 #4 0x000000000501be1f (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:80:0
 #5 0x000000000501c2fe CrashRecoverySignalHandler(int)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:362:0
 #6 0x00007f4aedb87390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #7 0x00007f4aec896428 raise
/build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
 #8 0x00007f4aec89802a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0
 #9 0x00007f4aec88ebd7 __assert_fail_base
/build/glibc-LK5gWL/glibc-2.23/assert/assert.c:92:0
#10 0x00007f4aec88ec82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#11 0x00000000082468c2
clang::Sema::CreateOverloadedBinOp(clang::SourceLocation,
clang::BinaryOperatorKind, clang::UnresolvedSetImpl const&, clang::Expr*,
clang::Expr*, bool, bool, clang::FunctionDecl*) /home/rxz226/llvm-project
/clang/lib/Sema/SemaOverload.cpp:13451:0
#12 0x0000000007ec2a64 BuildOverloadedBinOp(clang::Sema&, clang::Scope*,
clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*)
/home/rxz226/llvm-project/clang/lib/Sema/SemaExpr.cpp:13459:0
#13 0x0000000007ec33a1 clang::Sema::BuildBinOp(clang::Scope*,
clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*)
/home/rxz226/llvm-project/clang/lib/Sema/SemaExpr.cpp:13561:0
#14 0x0000000007ec2846 clang::Sema::ActOnBinOp(clang::Scope*,
clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*)
/home/rxz226/llvm-project/clang/lib/Sema/SemaExpr.cpp:13418:0
#15 0x0000000007a60acc
clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*,
true>, clang::prec::Level)
/home/rxz226/llvm-project/clang/lib/Parse/ParseExpr.cpp:629:0
#16 0x0000000007a5e8af
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
/home/rxz226/llvm-project/clang/lib/Parse/ParseExpr.cpp:177:0
#17 0x0000000007a35a42 clang::Parser::ParseInitializer()
/home/rxz226/llvm-project/clang/include/clang/Parse/Parser.h:1950:0
#18 0x0000000007a83d6f clang::Parser::ParseBraceInitializer()
/home/rxz226/llvm-project/clang/lib/Parse/ParseInit.cpp:481:0
#19 0x0000000007a2016f
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
/home/rxz226/llvm-project/clang/lib/Parse/ParseDecl.c
pp:2464:0
#20 0x0000000007a1e882 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/home/rxz226/llvm-project/clang/lib/Parse/ParseDecl.cpp:2129:0
#21 0x00000000079ff6cd
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:1110:0
#22 0x00000000079ff7ab
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:1125:0
#23 0x00000000079fec86
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:945:0
#24 0x00000000079fdf00
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:696:0
#25 0x00000000079fd881
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:564:0
#26 0x00000000079f97d7 clang::ParseAST(clang::Sema&, bool, bool)
/home/rxz226/llvm-project/clang/lib/Parse/ParseAST.cpp:157:0
#27 0x0000000005c0bed1 clang::ASTFrontendAction::ExecuteAction()
/home/rxz226/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1044:0
#28 0x00000000064f371e clang::CodeGenAction::ExecuteAction()
/home/rxz226/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1177:0
...
---

-- 
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/20200215/6d5847be/attachment.html>


More information about the llvm-bugs mailing list