[LLVMbugs] [Bug 13978] New: Clang crashes when processing decltype return in out-of-line definition for template member function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Sep 29 16:27:10 PDT 2012


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

             Bug #: 13978
           Summary: Clang crashes when processing decltype return in
                    out-of-line definition for template member function
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: seth.cantrell at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


// clang++ -std=c++11 -c main.cpp

template<typename T>
struct S {
    decltype(1) f();
};

template<typename T>
decltype(1)
S<T>::f() {
    return 1;
}

Here's a portion of the crash output

Assertion failed: (isTypeRep((TST) TypeSpecType) && "DeclSpec does not store a
type"), function getRepAsType, file
/Users/socantre/Programming/llvm/tools/clang/include/clang/Sema/DeclSpec.h,
line 449.

6  clang             0x0000000110e960c1 __assert_rtn + 129
7  clang             0x0000000111c57612 clang::DeclSpec::getRepAsType() const +
114
8  clang             0x0000000111c7b4f0
RebuildDeclaratorInCurrentInstantiation(clang::Sema&, clang::Declarator&,
clang::DeclarationName) + 128
9  clang             0x0000000111c7a0e3
clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&,
llvm::MutableArrayRef<clang::TemplateParameterList*>) + 1651
10 clang             0x0000000111f8d397
clang::Sema::ActOnStartOfFunctionTemplateDef(clang::Scope*,
llvm::MutableArrayRef<clang::TemplateParameterList*>, clang::Declarator&) + 231
11 clang             0x000000011171396a
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&,
llvm::SmallVector<clang::Parser::LateParsedAttribute*, 2u>*) + 3386
12 clang             0x0000000111700b34
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 2164
13 clang             0x00000001116ffe71
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1713
14 clang             0x00000001116ff643
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 323
15 clang             0x0000000111690845
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 437
16 clang             0x0000000111711097
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2247
17 clang             0x00000001117106ff
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 591
18 clang             0x00000001116848ff clang::ParseAST(clang::Sema&, bool,
bool) + 879
19 clang             0x00000001115bcec8
clang::ASTFrontendAction::ExecuteAction() + 312
20 clang             0x00000001113fab3b clang::CodeGenAction::ExecuteAction() +
1675
21 clang             0x00000001115bca87 clang::FrontendAction::Execute() + 263
22 clang             0x000000011157d592
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 930
23 clang             0x0000000110e9bde3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1331
24 clang             0x000000010fb6930b cc1_main(char const**, char const**,
char const*, void*) + 1707

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