Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

assert 'C++ binary operator overloading is missing candidates!' #7503

Open Quuxplusone opened 14 years ago

Quuxplusone commented 14 years ago
Bugzilla Link PR7051
Status REOPENED
Importance P normal
Reported by Christopher Jefferson (chris@bubblescope.net)
Reported on 2010-05-05 07:05:59 -0700
Last modified on 2018-04-18 17:03:42 -0700
Version trunk
Hardware PC All
CC dgregor@apple.com, kremenek@apple.com, llvm-bugs@lists.llvm.org, vanyacpp@gmail.com, zhonghao@pku.org.cn
Fixed by commit(s)
Attachments operator_missing.cc (177 bytes, application/octet-stream)
Blocks PR6023
Blocked by
See also
Created attachment 4827
Asserting test case derived from boost

This is reduced from the boost file
'./libs/test/example/unit_test_example_12.cpp'. (the original did not produce
this assert, it just crashed).

Assertion failed: (Result.isInvalid() && "C++ binary operator overloading is
missing candidates!"), function CreateOverloadedBinOp, file SemaOverload.cpp,
line 6210.
0  clang             0x00f57119 PrintStackTrace(void*) + 45
1  clang             0x00f57663 SignalHandler(int) + 374
2  libSystem.B.dylib 0x91cc842b _sigtramp + 43
3  libSystem.B.dylib 0xffffffff _sigtramp + 1848867839
4  libSystem.B.dylib 0x91d558e5 raise + 26
5  libSystem.B.dylib 0x91d6b99c abort + 93
6  libSystem.B.dylib 0x91d58544 __pthread_markcancel + 0
7  clang             0x0035a04f
clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, unsigned int,
clang::UnresolvedSetImpl const&, clang::Expr*, clang::Expr*) + 5001
8  clang             0x002f3901 clang::Sema::BuildBinOp(clang::Scope*,
clang::SourceLocation, clang::BinaryOperator::Opcode, clang::Expr*,
clang::Expr*) + 295
9  clang             0x002f3aa9 clang::Sema::ActOnBinOp(clang::Scope*,
clang::SourceLocation, clang::tok::TokenKind,
clang::ASTOwningResult<&(clang::ActionBase::DeleteExpr(void*))>,
clang::ASTOwningResult<&(clang::ActionBase::DeleteExpr(void*))>) + 263
10 clang             0x005ebd6d
clang::Parser::ParseRHSOfBinaryExpression(clang::ASTOwningResult<&(clang::ActionBase::DeleteExpr(void*))>,
clang::prec::Level) + 2501
11 clang             0x005e4326 clang::Parser::ParseAssignmentExpression() + 444
12 clang             0x005e4763 clang::Parser::ParseExpression() + 25
13 clang             0x006050c3
clang::Parser::ParseStatementOrDeclaration(bool) + 1679
14 clang             0x006097cb clang::Parser::ParseCompoundStatementBody(bool)
+ 215
15 clang             0x00609e2f
clang::Parser::ParseFunctionStatementBody(clang::OpaquePtr<0>) + 199
16 clang             0x005ca01e
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 1304
17 clang             0x005ca185
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 1663
18 clang             0x005dec3a
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int,
clang::OpaquePtr<0>) + 1534
19 clang             0x005dffa4
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool) + 4786
20 clang             0x005d3290
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 6508
21 clang             0x0060d877
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation&,
clang::AccessSpecifier) + 341
22 clang             0x0060e0f9
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 985
23 clang             0x0060e1e0
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 178
24 clang             0x005d74dc clang::Parser::ParseDeclaration(unsigned int,
clang::SourceLocation&, clang::CXX0XAttributeList) + 330
25 clang             0x006141bf
clang::Parser::ParseExternalDeclaration(clang::CXX0XAttributeList) + 1993
26 clang             0x006143ea
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<1>&) + 268
27 clang             0x0023f3f1 clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) + 426
28 clang             0x0006367f clang::ASTFrontendAction::ExecuteAction() + 269
29 clang             0x0006379c clang::FrontendAction::Execute() + 278
30 clang             0x00047427
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 879
31 clang             0x0002a11f cc1_main(char const**, char const**, char
const*, void*) + 1979
32 clang             0x0002e039 main + 272
33 clang             0x00028e5d start + 53
Stack dump:
0.  Program arguments: /usr/local/bin/clang -cc1 -triple i386-apple-darwin10.0.0
-S -disable-free -main-file-name operator_missing.cc -pic-level 1 -mdisable-fp-
elim -target-cpu yonah -resource-dir /usr/local/lib/clang/2.0 -ferror-limit 19 -
fmacro-backtrace-limit 6 -ftemplate-backtrace-limit 10 -fmessage-length 131 -
stack-protector 1 -fblocks -fexceptions -fdiagnostics-show-option -fcolor-
diagnostics -o /var/folders/M8/M86fCFVgGQ0r-V2oY5lLC++++TI/-Tmp-/cc-qKj9hz.s -x
c++ operator_missing.cc
1.  operator_missing.cc:13:16: current parser token ';'
2.  operator_missing.cc:6:1: parsing struct/union/class body 'basic_istream'
3.  operator_missing.cc:11:5: parsing function body
'basic_istream::sentry::sentry'
4.  operator_missing.cc:11:5: in compound statement ('{}')
clang: error: compiler command failed due to signal 6 (use -v to see invocation)
Quuxplusone commented 14 years ago

Attached operator_missing.cc (177 bytes, application/octet-stream): Asserting test case derived from boost

Quuxplusone commented 14 years ago

Possibly related: rdar://problem/7941392

Quuxplusone commented 14 years ago
Reduction:

enum E { e0 };

void f() {
  E e;
  e |= 1;
}
Quuxplusone commented 14 years ago

Fixed in r104475

Quuxplusone commented 6 years ago
I compile the testcase with the latest clang++. It produces an error message:

error: assigning to '_Ios_Iostate' from incompatible type 'int'
          __err |=1;
                ^ ~
    1 error generated.

However, g++ does not produce any compilation errors. I also report the problem
to gcc:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85460

They may have a different opinion on this issue.