[LLVMbugs] [Bug 7641] New: Assertion when 'using' to move function from one namespace to another

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 14 05:53:30 PDT 2010


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

           Summary: Assertion when 'using' to move function from one
                    namespace to another
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chris at bubblescope.net
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=5220)
 --> (http://llvm.org/bugs/attachment.cgi?id=5220)
Assertion example from 'using' statement

The attached (I believe valid) code causes an assertion in clang++. If you
change the last line from 'filesystem::' to filesystem2::', avoiding the
'using' statement, the code compiles fine. The generated assertion is attached
to other bugs, but I believe this is a different bug to those (or at least,
looks different, and valid code).

This bug is currently breaking boost::filesystem.

Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"),
function cast, file /Users/caj/clang/llvm/include/llvm/Support/Casting.h, line
202.
0  clang             0x00000001010ce676 PrintStackTrace(void*) + 38
1  clang             0x00000001010ceb84 SignalHandler(int) + 254
2  libSystem.B.dylib 0x00007fff8398c35a _sigtramp + 26
3  libSystem.B.dylib 000000000000000000 _sigtramp + 2087140544
4  libSystem.B.dylib 0x00007fff83a079b4 __pthread_markcancel + 0
5  clang             0x000000010035951a
llvm::cast_retty<clang::FunctionTemplateDecl, clang::NamedDecl*>::ret_type
llvm::cast<clang::FunctionTemplateDecl, clang::NamedDecl*>(clang::NamedDecl*
const&) + 78
6  clang             0x0000000100389770
clang::Sema::ResolveSingleFunctionTemplateSpecialization(clang::Expr*) + 326
7  clang             0x00000001003e31fe
ResolveOverloadForDeduction(clang::Sema&, clang::TemplateParameterList*,
clang::Expr*, clang::QualType) + 151
8  clang             0x00000001003e37e1
clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo const*, clang::Expr**, unsigned int,
clang::FunctionDecl*&, clang::Sema::TemplateDeductionInfo&) + 625
9  clang             0x0000000100394f21
clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*,
clang::DeclAccessPair, clang::TemplateArgumentListInfo const*, clang::Expr**,
unsigned int, clang::OverloadCandidateSet&, bool) + 243
10 clang             0x00000001003951e5
clang::AddOverloadedCallCandidate(clang::Sema&, clang::DeclAccessPair,
clang::TemplateArgumentListInfo const*, clang::Expr**, unsigned int,
clang::OverloadCandidateSet&, bool) + 297
11 clang             0x0000000100395664
clang::Sema::AddOverloadedCallCandidates(clang::UnresolvedLookupExpr*,
clang::Expr**, unsigned int, clang::OverloadCandidateSet&, bool) + 566
12 clang             0x0000000100397aa2
clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*,
clang::UnresolvedLookupExpr*, clang::SourceLocation, clang::Expr**, unsigned
int, clang::SourceLocation*, clang::SourceLocation) + 532
13 clang             0x0000000100337f04
clang::Sema::ActOnCallExpr(clang::Scope*,
clang::ASTOwningResult<&(clang::ActionBase::DeleteExpr(void*))>,
clang::SourceLocation,
clang::ASTMultiPtr<&(clang::ActionBase::DeleteExpr(void*))>,
clang::SourceLocation*, clang::SourceLocation) + 3072
14 clang             0x000000010069437b
clang::Parser::ParsePostfixExpressionSuffix(clang::ASTOwningResult<&(clang::ActionBase::DeleteExpr(void*))>)
+ 2097
15 clang             0x0000000100696dc9
clang::Parser::ParseCastExpression(bool, bool, bool&, void*) + 3495
16 clang             0x0000000100698c21
clang::Parser::ParseCastExpression(bool, bool, void*) + 97
17 clang             0x00000001006934a7
clang::Parser::ParseAssignmentExpression() + 241
18 clang             0x0000000100693a2e clang::Parser::ParseExpression() + 42
19 clang             0x00000001006b4c10
clang::Parser::ParseStatementOrDeclaration(bool) + 1662
20 clang             0x00000001006b9172
clang::Parser::ParseCompoundStatementBody(bool) + 220
21 clang             0x00000001006b979d
clang::Parser::ParseFunctionStatementBody(clang::OpaquePtr<0>) + 193
22 clang             0x00000001006c3845
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 1237
23 clang             0x0000000100685a56
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*) + 494
24 clang             0x00000001006c27f5
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AttributeList*, clang::AccessSpecifier) + 1069
25 clang             0x00000001006c2863
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::AttributeList*,
clang::AccessSpecifier) + 83
26 clang             0x00000001006c46f5
clang::Parser::ParseExternalDeclaration(clang::CXX0XAttributeList) + 2235
27 clang             0x00000001006c483f
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<1>&) + 247
28 clang             0x000000010025c5ad clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) + 456
29 clang             0x000000010007844a
clang::ASTFrontendAction::ExecuteAction() + 254
30 clang             0x000000010021fa70 clang::CodeGenAction::ExecuteAction() +
826
31 clang             0x0000000100078558 clang::FrontendAction::Execute() + 256
32 clang             0x000000010005b720
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 710
33 clang             0x0000000100027f28 cc1_main(char const**, char const**,
char const*, void*) + 1762
34 clang             0x000000010002ef81 main + 335
35 clang             0x0000000100026e48 start + 52
Stack dump:
0.    Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-apple-darwin10.0.0 -emit-obj -mrelax-all -disable-free -main-file-name
double-namespace.cc -pic-level 1 -mdisable-fp-elim -masm-verbose
-munwind-tables -target-cpu core2 -resource-dir /usr/local/lib/clang/2.8
-ferror-limit 19 -fmessage-length 80 -stack-protector 1 -fblocks -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/M8/M86fCFVgGQ0r-V2oY5lLC++++TI/-Tmp-/cc-PadPwD.o -x c++
double-namespace.cc 
1.    double-namespace.cc:19:43: current parser token ')'
2.    double-namespace.cc:19:1: parsing function body 'main'
3.    double-namespace.cc:19:1: in compound statement ('{}')
clang: error: clang frontend command failed due to signal 6 (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