llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.47k stars 11.77k forks source link

Assertion failure S.Context.hasSameUnqualifiedType(T, E->getRHS()->getType()) && "comparison with mismatched types") #8304

Closed llvmbot closed 14 years ago

llvmbot commented 14 years ago
Bugzilla Link 7932
Resolution DUPLICATE
Resolved on Aug 18, 2010 13:42
Version trunk
OS MacOS X
Attachments Gzipped preprocessed source
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@efriedma-quic

Extended Description

I get the following error message trying to compile a C++ program. The preprocessed source is attached.

Assertion failed: (S.Context.hasSameUnqualifiedType(T, E->getRHS()->getType()) && "comparison with mismatched types"), function AnalyzeComparison, file /Users/troyer/svn/llvm/tools/clang/lib/Sema/SemaChecking.cpp, line 2458. 0 clang 0x000000010116d747 PrintStackTrace(void) + 38 1 clang 0x000000010116dc55 SignalHandler(int) + 254 2 libSystem.B.dylib 0x00007fff86ac135a _sigtramp + 26 3 libSystem.B.dylib 0x00007fff5fbf8490 _sigtramp + 3641930064 4 libSystem.B.dylib 0x00007fff86b3c9b4 __pthread_markcancel + 0 5 clang 0x000000010028feec (anonymous namespace)::AnalyzeComparison(clang::Sema&, clang::BinaryOperator) + 161 6 clang 0x00000001002902ff (anonymous namespace)::AnalyzeImplicitConversions(clang::Sema&, clang::Expr) + 293 7 clang 0x00000001002904c3 (anonymous namespace)::CheckConditionalOperator(clang::Sema&, clang::ConditionalOperator, clang::QualType) + 62 8 clang 0x0000000100290232 (anonymous namespace)::AnalyzeImplicitConversions(clang::Sema&, clang::Expr) + 88 9 clang 0x0000000100290373 (anonymous namespace)::AnalyzeImplicitConversions(clang::Sema&, clang::Expr) + 409 10 clang 0x0000000100290373 (anonymous namespace)::AnalyzeImplicitConversions(clang::Sema&, clang::Expr) + 409 11 clang 0x00000001002902a2 (anonymous namespace)::AnalyzeImplicitConversions(clang::Sema&, clang::Expr) + 200 12 clang 0x0000000100290373 (anonymous namespace)::AnalyzeImplicitConversions(clang::Sema&, clang::Expr) + 409 13 clang 0x0000000100290373 (anonymous namespace)::AnalyzeImplicitConversions(clang::Sema&, clang::Expr) + 409 14 clang 0x0000000100290373 (anonymous namespace)::AnalyzeImplicitConversions(clang::Sema&, clang::Expr) + 409 15 clang 0x00000001002903f4 clang::Sema::CheckImplicitConversions(clang::Expr) + 100 16 clang 0x000000010036eec3 clang::Sema::MaybeCreateCXXExprWithTemporaries(clang::Expr) + 77 17 clang 0x000000010036f013 clang::Sema::ActOnFinishFullExpr(clang::ASTOwningPtr<&(clang::ActionBase::DeleteExpr(void))>) + 49 18 clang 0x00000001004084ef clang::Action::FullExprArg clang::Action::MakeFullExpr<clang::ASTOwningResult<&(clang::ActionBase::DeleteExpr(void))> >(clang::ASTOwningResult<&(clang::ActionBase::DeleteExpr(void))>&) + 75 19 clang 0x00000001006e676b clang::Parser::ParseStatementOrDeclaration(bool) + 1579 20 clang 0x00000001006e93fa clang::Parser::ParseCompoundStatementBody(bool) + 202 21 clang 0x00000001006e9a0c clang::Parser::ParseCompoundStatement(clang::AttributeList, bool) + 164 22 clang 0x00000001006e67f0 clang::Parser::ParseStatementOrDeclaration(bool) + 1712 23 clang 0x00000001006ea554 clang::Parser::ParseStatement() + 26 24 clang 0x00000001006e74cb clang::Parser::ParseForStatement(clang::AttributeList) + 2489 25 clang 0x00000001006e68ea clang::Parser::ParseStatementOrDeclaration(bool) + 1962 26 clang 0x00000001006e93fa clang::Parser::ParseCompoundStatementBody(bool) + 202 27 clang 0x00000001006e98a1 clang::Parser::ParseFunctionStatementBody(clang::OpaquePtr<0>) + 189 28 clang 0x00000001006f3093 clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&) + 1131 29 clang 0x00000001006ece80 clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::AccessSpecifier) + 1214 30 clang 0x00000001006ed3a7 clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int, clang::SourceLocation&, clang::AccessSpecifier) + 999 31 clang 0x00000001006ed48e clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int, clang::SourceLocation&, clang::AccessSpecifier) + 158 32 clang 0x00000001006c14f8 clang::Parser::ParseDeclaration(unsigned int, clang::SourceLocation&, clang::CXX0XAttributeList) + 348 33 clang 0x00000001006f3db8 clang::Parser::ParseExternalDeclaration(clang::CXX0XAttributeList) + 1840 34 clang 0x00000001006c982b clang::Parser::ParseNamespace(unsigned int, clang::SourceLocation&) + 1287 35 clang 0x00000001006c1558 clang::Parser::ParseDeclaration(unsigned int, clang::SourceLocation&, clang::CXX0XAttributeList) + 444 36 clang 0x00000001006f3db8 clang::Parser::ParseExternalDeclaration(clang::CXX0XAttributeList) + 1840 37 clang 0x00000001006c982b clang::Parser::ParseNamespace(unsigned int, clang::SourceLocation&) + 1287 38 clang 0x00000001006c1558 clang::Parser::ParseDeclaration(unsigned int, clang::SourceLocation&, clang::CXX0XAttributeList) + 444 39 clang 0x00000001006f3db8 clang::Parser::ParseExternalDeclaration(clang::CXX0XAttributeList) + 1840 40 clang 0x00000001006f3fe7 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<1>&) + 247 41 clang 0x00000001002746fc clang::ParseAST(clang::Sema&, bool) + 279 42 clang 0x00000001000886ea clang::ASTFrontendAction::ExecuteAction() + 234 43 clang 0x0000000100235994 clang::CodeGenAction::ExecuteAction() + 826 44 clang 0x00000001000887f2 clang::FrontendAction::Execute() + 256 45 clang 0x000000010006a0ad clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 711 46 clang 0x0000000100087db9 clang::ExecuteCompilerInvocation(clang::CompilerInstance) + 727 47 clang 0x0000000100029a22 cc1_main(char const, char const, char const, void*) + 862 48 clang 0x0000000100030cea main + 450 49 clang 0x00000001000292c8 start + 52 50 clang 0x0000000000000023 start + 4294798735 Stack dump:

  1. Program arguments: /usr/local/bin/clang -cc1 -triple x86_64-apple-darwin10.0.0 -emit-obj -mrelax-all -disable-free -main-file-name pyalea.cpp.ii -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 97.14 -resource-dir /usr/local/lib/clang/2.8 -ferror-limit 19 -fmessage-length 132 -stack-protector 1 -fblocks -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-Vx5f3a.o -x c++-cpp-output pyalea.cpp.ii
  2. /Users/troyer/svn/alps/src/alps/python/pyalea.cpp:339:17: current parser token 'error'
  3. /Users/troyer/svn/alps/src/alps/python/pyalea.cpp:53:1: parsing namespace 'alps'
  4. /Users/troyer/svn/alps/src/alps/python/pyalea.cpp:54:3: parsing namespace 'alps::alea'
  5. /Users/troyer/svn/alps/src/alps/python/pyalea.cpp:335:101: parsing function body 'alps::alea::print_mcdata'
  6. /Users/troyer/svn/alps/src/alps/python/pyalea.cpp:335:101: in compound statement ('{}')
  7. /Users/troyer/svn/alps/src/alps/python/pyalea.cpp:337:110: in compound statement ('{}') clang: error: clang frontend command failed due to signal 6 (use -v to see invocation) ogdoad:~ troyer$
efriedma-quic commented 14 years ago

This is very similar to, if not exactly the same issue as, bug 7851.

This bug has been marked as a duplicate of bug llvm/llvm-project#8223