[LLVMbugs] [Bug 10355] New: crash after typo correction of template-id to templated function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 13 20:07:45 PDT 2011


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

           Summary: crash after typo correction of template-id to
                    templated function
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


This testcase:

  template<typename T> void template_id1() {
    template_id2<> t;
  }

crashes:

nlewycky at ducttape:~$ llvm/Debug+Asserts/bin/clang -cc1 reduced.cc
reduced.cc:3:3: error: use of undeclared identifier 'template_id2'; did you
mean 'template_id1'?
  template_id2<> t;
  ^~~~~~~~~~~~
  template_id1
0  clang           0x00000000027d2e31
1  clang           0x00000000027d2c24
2  libpthread.so.0 0x00007fb42ec148f0
3  clang           0x000000000104beda clang::Decl::getLocation() const + 12
4  clang           0x00000000013ea351 clang::Sema::ClassifyName(clang::Scope*,
clang::CXXScopeSpec&, clang::IdentifierInfo*&, clang::SourceLocation,
clang::Token const&) + 3221
5  clang           0x00000000013275cc
clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*,
32u>&, bool) + 844
6  clang           0x0000000001329ae3
clang::Parser::ParseCompoundStatementBody(bool) + 1113
7  clang           0x000000000132d75d
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 245
8  clang           0x000000000133d272
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 2518
9  clang           0x000000000132fe2e
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier) + 1322
10 clang           0x000000000132f8b6
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 996
11 clang           0x000000000132f43b
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 175
12 clang           0x00000000013482c3
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 193
13 clang           0x000000000133bcb6
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 1494
14 clang           0x000000000133b631
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 309
15 clang           0x000000000131a026 clang::ParseAST(clang::Sema&, bool) + 455
16 clang           0x000000000104b95d clang::ASTFrontendAction::ExecuteAction()
+ 263
17 clang           0x000000000104b5ae clang::FrontendAction::Execute() + 326
18 clang           0x0000000001031031
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 751
19 clang           0x0000000001005033
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 912
20 clang           0x0000000000ff625c cc1_main(char const**, char const**, char
const*, void*) + 987
21 clang           0x00000000010006ea main + 499
22 libc.so.6       0x00007fb42deeec4d __libc_start_main + 253
23 clang           0x0000000000ff58f9
Stack dump:
0.      Program arguments: llvm/Debug+Asserts/bin/clang -cc1 reduced.cc 
1.      reduced.cc:3:3: current parser token 'template_id2'
2.      reduced.cc:2:1: parsing function body 'template_id1'
3.      reduced.cc:2:1: in compound statement ('{}')
Segmentation fault

-- 
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