[LLVMbugs] [Bug 9974] New: Assertion "Assertion `Arg != S.Context.OverloadTy && "Unresolved overloaded function"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 20 14:10:05 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=9974

           Summary: Assertion "Assertion `Arg != S.Context.OverloadTy &&
                    "Unresolved overloaded function"' failed.
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chris at bubblescope.net
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The invalid C++0x code (the rvalue reference is required), derived from a boost
test case, causes clang to assert.

template <int> struct enable_if;
template <class > struct remove_reference ;
template <class _Tp> struct remove_reference<_Tp&> ;

template <class > struct __tuple_like;

template <class _Tp, class _Up, int = __tuple_like<typename
remove_reference<_Tp>::type>::value> 
struct __tuple_convertible;

struct pair
{
template<class _Tuple, int = enable_if<__tuple_convertible<_Tuple,
pair>::value>::type> 
pair(_Tuple&& );
};

template <class> struct basic_ostream;

template <int> 
void endl( ) ;

extern basic_ostream<char> cout;

int operator<<( basic_ostream<char> , pair ) ;

void register_object_imp ( )
{
cout << endl<1>;
}




aj at nyanko:/dev/shm/clang-3$ /llvmdebug/bin/clang++ t.cc -c
t.cc:13:12: warning: rvalue references are a C++0x extension
[-Wc++0x-extensions]
pair(_Tuple&& );
           ^
t.cc:12:28: warning: default template arguments for a function template are a
C++0x extension [-Wc++0x-extensions]                                            
template<class _Tuple, int = enable_if<__tuple_convertible<_Tuple,
pair>::value>::type> 
                           ^
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clang: SemaTemplateDeduction.cpp:1001: clang::Sema::TemplateDeductionResult
DeduceTemplateArguments(clang::Sema&, clang::TemplateParameterList*,
clang::QualType, clang::QualType, clang::sema::TemplateDeductionInfo&,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, bool,
llvm::SmallVectorImpl<RefParamPartialOrderingComparison>*): Assertion `Arg !=
S.Context.OverloadTy && "Unresolved overloaded function"' failed.
0  clang           0x0000000002649982
1  clang           0x000000000264977e
2  libpthread.so.0 0x00007f9bc32c2c60
3  libc.so.6       0x00007f9bc25add05 gsignal + 53
4  libc.so.6       0x00007f9bc25b1ab6 abort + 390
5  libc.so.6       0x00007f9bc25a67c5 __assert_fail + 245
6  clang           0x00000000016f2ce6
7  clang           0x00000000016f32ac
8  clang           0x00000000016f4212
9  clang           0x00000000016f4afe
10 clang           0x00000000016f5285
11 clang           0x00000000016f67c4
clang::Sema::DeduceTemplateArguments(clang::ClassTemplatePartialSpecializationDecl*,
clang::TemplateArgumentList const&, clang::sema::TemplateDeductionInfo&) + 210
12 clang           0x0000000001726e38
clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind,
bool) + 546
13 clang           0x000000000178344d
clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType,
clang::PartialDiagnostic const&, std::pair<clang::SourceLocation,
clang::PartialDiagnostic>) + 315
14 clang           0x0000000001783823
clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType,
clang::PartialDiagnostic const&) + 111
15 clang           0x00000000014fe1a3
clang::Sema::RequireCompleteDeclContext(clang::CXXScopeSpec&,
clang::DeclContext*) + 353
16 clang           0x00000000016ab04c
clang::Sema::CheckTypenameType(clang::ElaboratedTypeKeyword,
clang::SourceLocation, clang::NestedNameSpecifierLoc, clang::IdentifierInfo
const&, clang::SourceLocation) + 320
17 clang           0x000000000173ff1e
18 clang           0x000000000173160f
19 clang           0x000000000172a007
20 clang           0x0000000001729886
21 clang           0x00000000017453a4
22 clang           0x0000000001746b2f
23 clang           0x000000000173fa64
24 clang           0x000000000173e3cd
25 clang           0x000000000172ce18
26 clang           0x000000000173a280
27 clang           0x000000000172bd83
28 clang           0x0000000001727bc9 clang::Sema::SubstExpr(clang::Expr*,
clang::MultiLevelTemplateArgumentList const&) + 121
29 clang           0x000000000169bd74
30 clang           0x000000000169d8f5
clang::Sema::CheckTemplateArgumentList(clang::TemplateDecl*,
clang::SourceLocation, clang::TemplateArgumentListInfo&, bool,
llvm::SmallVectorImpl<clang::TemplateArgument>&) + 2125
31 clang           0x00000000016996b4
clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation,
clang::TemplateArgumentListInfo&) + 520
32 clang           0x0000000001746c31
33 clang           0x000000000173fab8
34 clang           0x000000000173e3cd
35 clang           0x000000000172ce18
36 clang           0x000000000173a280
37 clang           0x000000000172bd83
38 clang           0x000000000174595e
39 clang           0x0000000001746b2f
40 clang           0x000000000173fa64
41 clang           0x000000000173e3cd
42 clang           0x000000000172ce18
43 clang           0x000000000173a280
44 clang           0x000000000172bd83
45 clang           0x0000000001727bc9 clang::Sema::SubstExpr(clang::Expr*,
clang::MultiLevelTemplateArgumentList const&) + 121
46 clang           0x000000000169bd74
47 clang           0x000000000169c1c4
clang::Sema::SubstDefaultTemplateArgumentIfAvailable(clang::TemplateDecl*,
clang::SourceLocation, clang::SourceLocation, clang::Decl*,
llvm::SmallVectorImpl<clang::TemplateArgument>&) + 468
48 clang           0x00000000016f7813
clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&) + 1549
49 clang           0x00000000016f9196
clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo*, clang::Expr**, unsigned int,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&) + 2690
50 clang           0x0000000001668111
clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*,
clang::DeclAccessPair, clang::TemplateArgumentListInfo*, clang::Expr**,
unsigned int, clang::OverloadCandidateSet&, bool) + 243
51 clang           0x0000000001661546
52 clang           0x000000000165c246
53 clang           0x0000000001665194
54 clang           0x000000000166717a
clang::Sema::AddOverloadCandidate(clang::FunctionDecl*, clang::DeclAccessPair,
clang::Expr**, unsigned int, clang::OverloadCandidateSet&, bool, bool) + 1334
55 clang           0x0000000001667476
clang::Sema::AddFunctionCandidates(clang::UnresolvedSetImpl const&,
clang::Expr**, unsigned int, clang::OverloadCandidateSet&, bool) + 520
56 clang           0x0000000001674c54
clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, unsigned int,
clang::UnresolvedSetImpl const&, clang::Expr*, clang::Expr*) + 1636
57 clang           0x00000000015e3540 clang::Sema::BuildBinOp(clang::Scope*,
clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) +
498
58 clang           0x00000000015e334c clang::Sema::ActOnBinOp(clang::Scope*,
clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) + 184
59 clang           0x00000000014c7268
clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*,
true>, clang::prec::Level) + 2132
60 clang           0x00000000014c691d
clang::Parser::ParseAssignmentExpression() + 207
61 clang           0x00000000014c66ee clang::Parser::ParseExpression() + 24
62 clang           0x0000000001492923
clang::Parser::ParseExprStatement(clang::ParsedAttributes&) + 77
63 clang           0x00000000014924e5
clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*,
32u>&, bool) + 2221
64 clang           0x00000000014943b9
clang::Parser::ParseCompoundStatementBody(bool) + 1103
65 clang           0x0000000001497f3e
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 240
66 clang           0x00000000014a5d74
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 2820
67 clang           0x00000000014af55b
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 521
68 clang           0x00000000014a51d5
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 1007
69 clang           0x00000000014a5251
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 113
70 clang           0x00000000014a4ac6
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 2428
71 clang           0x00000000014a40a7
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 283
72 clang           0x000000000148505c clang::ParseAST(clang::Sema&, bool) + 416
73 clang           0x00000000011f119f clang::ASTFrontendAction::ExecuteAction()
+ 263
74 clang           0x0000000001325a7b clang::CodeGenAction::ExecuteAction() +
927
75 clang           0x00000000011f0dfb clang::FrontendAction::Execute() + 325
76 clang           0x00000000011d7feb
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 741
77 clang           0x000000000117ee13
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 909
78 clang           0x000000000117034a cc1_main(char const**, char const**, char
const*, void*) + 952
79 clang           0x000000000117a5a3 main + 496
80 libc.so.6       0x00007f9bc2598eff __libc_start_main + 255
81 clang           0x000000000116fa19
Stack dump:
0.      Program arguments: /llvmdebug/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
t.cc -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.21.51.20110409 -momit-leaf-frame-pointer -coverage-file t.o -resource-dir
/llvmdebug/bin/../lib/clang/3.0 -fdeprecated-macro -ferror-limit 19
-fmessage-length 173 -fcxx-exceptions -fexceptions -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o t.o -x c++ t.cc 
1.      t.cc:27:16: current parser token ';'
2.      t.cc:26:1: parsing function body 'register_object_imp'
3.      t.cc:26:1: in compound statement ('{}')
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list