[LLVMbugs] [Bug 9458] New: Assertion 'is<T>() && "Invalid accessor called"' on invalid code.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 11 07:19:09 PST 2011


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

           Summary: Assertion 'is<T>() && "Invalid accessor called"' on
                    invalid code.
           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


The code:

template<>template<a>struct a{

Produces the backtrace:

t.bashed.28853.cc:1:20: error: unknown type name 'a'
template<>template<a>struct a{
                   ^
t.bashed.28853.cc:1:1: warning: extraneous template parameter list in template
specialization                                                                  
template<>template<a>struct a{
^~~~~~~~~~
clang: /home/caj/llvm-debug/include/llvm/ADT/PointerUnion.h:129: T
llvm::PointerUnion<PT1, PT2>::get() const [with T = clang::QualifierInfo*, PT1
= clang::TypedefDecl*, PT2 = clang::QualifierInfo*]: Assertion `is<T>() &&
"Invalid accessor called"' failed.
0  clang           0x00000000023fb09d
1  clang           0x00000000023fae90
2  libpthread.so.0 0x00007f90f331c8f0
3  libc.so.6       0x00007f90f260ba75 gsignal + 53
4  libc.so.6       0x00007f90f260f5c0 abort + 384
5  libc.so.6       0x00007f90f2604941 __assert_fail + 241
6  clang           0x0000000000fdacab
7  clang           0x0000000001125448 clang::TagDecl::getExtInfo() + 28
8  clang           0x000000000136f228
clang::TagDecl::setTemplateParameterListsInfo(clang::ASTContext&, unsigned int,
clang::TemplateParameterList**) + 36
9  clang           0x0000000001487bc4
clang::Sema::CheckClassTemplate(clang::Scope*, unsigned int,
clang::Sema::TagUseKind, clang::SourceLocation, clang::CXXScopeSpec&,
clang::IdentifierInfo*, clang::SourceLocation, clang::AttributeList*,
clang::TemplateParameterList*, clang::AccessSpecifier, unsigned int,
clang::TemplateParameterList**) + 3010
10 clang           0x00000000013656c0 clang::Sema::ActOnTag(clang::Scope*,
unsigned int, clang::Sema::TagUseKind, clang::SourceLocation,
clang::CXXScopeSpec&, clang::IdentifierInfo*, clang::SourceLocation,
clang::AttributeList*, clang::AccessSpecifier,
clang::ASTMultiPtr<clang::TemplateParameterList*>, bool&, bool&, bool, bool,
clang::ActionResult<clang::OpaquePtr<clang::QualType>, false>) + 562
11 clang           0x00000000012c83d3
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool) + 5359
12 clang           0x00000000012bb618
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 6324
13 clang           0x00000000012e0cad
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier) + 385
14 clang           0x00000000012e0ade
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 996
15 clang           0x00000000012e0663
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 175
16 clang           0x00000000012b81fb
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 185
17 clang           0x00000000012b15bb
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 1225
18 clang           0x00000000012b1062
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 210
19 clang           0x0000000001299705 clang::ParseAST(clang::Sema&, bool) + 328
20 clang           0x00000000010015c1 clang::ASTFrontendAction::ExecuteAction()
+ 263
21 clang           0x000000000113bfaf clang::CodeGenAction::ExecuteAction() +
947
22 clang           0x0000000001001212 clang::FrontendAction::Execute() + 320
23 clang           0x0000000000fe9ec9
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 751
24 clang           0x0000000000f93583
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 912
25 clang           0x0000000000f855c7 cc1_main(char const**, char const**, char
const*, void*) + 982
26 clang           0x0000000000f8ea3c main + 499
27 libc.so.6       0x00007f90f25f6c4d __libc_start_main + 253
28 clang           0x0000000000f84c69
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.bashed.28853.cc -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.20.1 -momit-leaf-frame-pointer -resource-dir /llvmdebug/bin/../lib/clang/3.0
-ferror-limit 19 -fmessage-length 173 -fcxx-exceptions -fexceptions
-fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-ORMXxx.o
-x c++ t.bashed.28853.cc 
1.      t.bashed.28853.cc:1:30: current parser token '{'
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