[LLVMbugs] [Bug 13494] New: Crash while on an invalid member function specialization

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 31 14:52:24 PDT 2012


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

             Bug #: 13494
           Summary: Crash while on an invalid member function
                    specialization
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: crash-on-invalid
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: gribozavr at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8973
  --> http://llvm.org/bugs/attachment.cgi?id=8973
Testcase

/Volumes/Data/clang-commit/build/Debug+Asserts/bin/clang -cc1 -internal-isystem
/Volumes/Data/clang-commit/build/Debug+Asserts/bin/../lib/clang/3.2/include
-fsyntax-only -Wdocumentation -Wdocumentation-pedantic /tmp/yyy.cc 
/tmp/yyy.cc:8:12: error: template specialization requires 'template<>'
void C<T>::test_attach27<>(int aaa, int bbb) {}
           ^            ~~
template<> 
Assertion failed: (TemplateTypeParm->getDepth() == 0 && "Can't deduce with
depth > 0"), function DeduceTemplateArgumentsByTypeMatch, file
/Volumes/Data/clang-commit/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp,
line 1012.
0  clang             0x000000010c8eceee PrintStackTrace(void*) + 46
1  clang             0x000000010c8ed499 SignalHandler(int) + 297
2  libsystem_c.dylib 0x00007fff8e8fb92a _sigtramp + 26
3  libsystem_c.dylib 0x00007fff557ae658 _sigtramp + 18446744072751885640
4  clang             0x000000010c8ed1bb raise + 27
5  clang             0x000000010c8ed272 abort + 18
6  clang             0x000000010c8ed251 __assert_rtn + 129
7  clang             0x000000010acb54cf
DeduceTemplateArgumentsByTypeMatch(clang::Sema&, clang::TemplateParameterList*,
clang::QualType, clang::QualType, clang::sema::TemplateDeductionInfo&,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, bool,
llvm::SmallVectorImpl<RefParamPartialOrderingComparison>*) + 2047
8  clang             0x000000010ace790f DeduceTemplateArguments(clang::Sema&,
clang::TemplateParameterList*, clang::QualType const*, unsigned int,
clang::QualType const*, unsigned int, clang::sema::TemplateDeductionInfo&,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, bool,
llvm::SmallVectorImpl<RefParamPartialOrderingComparison>*) + 463
9  clang             0x000000010acb6cdb
DeduceTemplateArgumentsByTypeMatch(clang::Sema&, clang::TemplateParameterList*,
clang::QualType, clang::QualType, clang::sema::TemplateDeductionInfo&,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, bool,
llvm::SmallVectorImpl<RefParamPartialOrderingComparison>*) + 8203
10 clang             0x000000010acb8614
clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo*, clang::QualType, clang::FunctionDecl*&,
clang::sema::TemplateDeductionInfo&) + 564
11 clang             0x000000010ac52ea8
clang::Sema::CheckFunctionTemplateSpecialization(clang::FunctionDecl*,
clang::TemplateArgumentListInfo*, clang::LookupResult&) + 440
12 clang             0x000000010a9acd0f
clang::Sema::ActOnFunctionDeclarator(clang::Scope*, clang::Declarator&,
clang::DeclContext*, clang::TypeSourceInfo*, clang::LookupResult&,
clang::ASTMultiPtr<clang::TemplateParameterList*>, bool&) + 12047
13 clang             0x000000010a9a8d1d
clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&,
clang::ASTMultiPtr<clang::TemplateParameterList*>) + 2797
14 clang             0x000000010ac523f3
clang::Sema::ActOnStartOfFunctionTemplateDef(clang::Scope*,
clang::ASTMultiPtr<clang::TemplateParameterList*>, clang::Declarator&) + 275
15 clang             0x000000010a8ac1a2
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&,
llvm::SmallVector<clang::Parser::LateParsedAttribute*, 2u>*) + 2002
16 clang             0x000000010a89d7fb
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1627
17 clang             0x000000010a89ce0c
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1356
18 clang             0x000000010a89c7a7
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 215
19 clang             0x000000010a844744
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 388
20 clang             0x000000010a8aa2e3
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1843
21 clang             0x000000010a8a9b42
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 466
22 clang             0x000000010a83aa76 clang::ParseAST(clang::Sema&, bool,
bool) + 550
23 clang             0x000000010a4ed868
clang::ASTFrontendAction::ExecuteAction() + 312
24 clang             0x000000010a4ed470 clang::FrontendAction::Execute() + 240
25 clang             0x000000010a4b70ea
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 890
26 clang             0x000000010a461341
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 961
27 clang             0x000000010a449fe9 cc1_main(char const**, char const**,
char const*, void*) + 969
28 clang             0x000000010a45adb9 main + 473
29 libdyld.dylib     0x00007fff8e43e7e1 start + 0
Stack dump:
0.    Program arguments:
/Volumes/Data/clang-commit/build/Debug+Asserts/bin/clang -cc1 -internal-isystem
/Volumes/Data/clang-commit/build/Debug+Asserts/bin/../lib/clang/3.2/include
-fsyntax-only -Wdocumentation -Wdocumentation-pedantic /tmp/yyy.cc 
1.    /tmp/yyy.cc:8:46: current parser token '{'
Illegal instruction: 4

Clang from SVN r160965.

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