[LLVMbugs] [Bug 11599] New: Crash on invalid with TSK_ExplicitInstantiationDefinition after an invalid TSK_ExplicitInstantiationDeclaration

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 16 10:23:16 PST 2011


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

             Bug #: 11599
           Summary: Crash on invalid with
                    TSK_ExplicitInstantiationDefinition after an invalid
                    TSK_ExplicitInstantiationDeclaration
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


hummer:clang thakis$ cat bug2.cc
namespace std {

template<typename _CharT>
class basic_string;

typedef basic_string<char> string;

template <typename STRING_TYPE> class BasicStringPiece;

extern template class BasicStringPiece<std::string>;
template class BasicStringPiece<std::string>;

}  // namespace std
hummer:clang thakis$ ../../Release+Asserts/bin/clang -c bug2.cc
bug2.cc:10:23: error: explicit instantiation of undefined template
'std::BasicStringPiece<std::string>'
extern template class BasicStringPiece<std::string>;
                      ^
bug2.cc:8:39: note: template is declared here
template <typename STRING_TYPE> class BasicStringPiece;
                                      ^
Assertion failed: (DefinitionData && "queried property of class with no
definition"), function data, file
/Volumes/MacintoshHD2/src/llvm-svn/tools/clang/lib/Sema/../../include/clang/AST/DeclCXX.h,
line 531.
0  clang             0x00000001015588a2 PrintStackTrace(void*) + 34
1  clang             0x0000000101558dd9 SignalHandler(int) + 713
2  libSystem.B.dylib 0x00007fff84b4e1ba _sigtramp + 26
3  libSystem.B.dylib 0x0000000000000090 _sigtramp + 2068520688
4  clang             0x0000000100047a46 abort + 22
5  clang             0x0000000100047a98 __assert_rtn + 56
6  clang             0x00000001003e2a28
clang::Sema::ActOnCXXConditionDeclaration(clang::Scope*, clang::Declarator&) +
0
7  clang             0x000000010058d496
clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind,
bool) + 196
8  clang             0x000000010050ee00
clang::Sema::ActOnExplicitInstantiation(clang::Scope*, clang::SourceLocation,
clang::SourceLocation, unsigned int, clang::SourceLocation, clang::CXXScopeSpec
const&, clang::OpaquePtr<clang::TemplateName>, clang::SourceLocation,
clang::SourceLocation, clang::ASTTemplateArgsPtr, clang::SourceLocation,
clang::AttributeList*) + 1522
9  clang             0x00000001002caf28
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, bool) + 2710
10 clang             0x00000001002bde9e
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 6218
11 clang             0x00000001002f7bc5
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier, clang::AttributeList*) + 717
12 clang             0x00000001002f486d
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 429
13 clang             0x00000001002c1003
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 381
14 clang             0x000000010030194e
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 1776
15 clang             0x00000001002cc8ba
clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*,
std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&,
clang::ParsedAttributes&, clang::Parser::BalancedDelimiterTracker&) + 256
16 clang             0x00000001002c265b clang::Parser::ParseNamespace(unsigned
int, clang::SourceLocation&, clang::SourceLocation) + 3323
17 clang             0x00000001002c10ab
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 549
18 clang             0x000000010030194e
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 1776
19 clang             0x000000010030247e
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 262
20 clang             0x00000001002ad1a5 clang::ParseAST(clang::Sema&, bool) +
325
21 clang             0x0000000100278bfc clang::CodeGenAction::ExecuteAction() +
924
22 clang             0x00000001000693f6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 962
23 clang             0x0000000100051391
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2161
24 clang             0x000000010004b40b cc1_main(char const**, char const**,
char const*, void*) + 2939
25 clang             0x000000010004e410 main + 640
26 clang             0x000000010004a87c start + 52
Stack dump:
0.    Program arguments:
/Volumes/MacintoshHD2/src/llvm-svn/Release+Asserts/bin/clang -cc1 -triple
x86_64-apple-macosx10.6.8 -emit-obj -mrelax-all -disable-free -main-file-name
bug2.cc -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables
-target-cpu core2 -target-linker-version 97.17 -coverage-file bug2.o
-resource-dir
/Volumes/MacintoshHD2/src/llvm-svn/Release+Asserts/bin/../lib/clang/3.1
-fmodule-cache-path
/var/folders/++/++1Gyk++6+0++4RjPqRgNE++ojg/-Tmp-/clang-module-cache
-fdeprecated-macro -fdebug-compilation-dir
/Users/thakis/src/llvm-svn/tools/clang -ferror-limit 19 -fmessage-length 354
-stack-protector 1 -mstackrealign -fblocks -fobjc-dispatch-method=mixed
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
bug2.o -x c++ bug2.cc 
1.    bug2.cc:11:45: current parser token ';'
2.    bug2.cc:1:1: parsing namespace 'std'
clang: error: unable to execute command: Illegal instruction
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang: note: diagnostic msg:
/var/folders/++/++1Gyk++6+0++4RjPqRgNE++ojg/-Tmp-/bug2-VDGar1.ii
clang: note: diagnostic msg:
/var/folders/++/++1Gyk++6+0++4RjPqRgNE++ojg/-Tmp-/bug2-VDGar1.sh
hummer:clang thakis$ ../../Release+Asserts/bin/clang --version
clang version 3.1 (trunk 146741)
Target: x86_64-apple-darwin10.8.0
Thread model: posix

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