[LLVMbugs] [Bug 18542] New: crash defining method of undefined class inside an incomplete type

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jan 19 01:08:49 PST 2014


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

            Bug ID: 18542
           Summary: crash defining method of undefined class inside an
                    incomplete type
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nlewycky at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

nlewycky at ducttape:~/delta-2006.08.03$ cat 175.c
struct X {
  int count;
  template<typename CharT> class basic_istream;
  template<typename CharT>
    void basic_istream<CharT>::read() {
      count = 0;
    }
};
nlewycky at ducttape:~/delta-2006.08.03$ ~/llvm/Debug+Asserts/bin/clang
-fsyntax-only -x c++ 175.c
175.c:5:32: error: out-of-line definition of 'read' from class
      'basic_istream<CharT>' without definition
    void basic_istream<CharT>::read() {
         ~~~~~~~~~~~~~~~~~~~~~~^
clang:
/usr/local/google/home/nlewycky/llvm/tools/clang/lib/Serialization/../../include/clang/AST/DeclCXX.h:562:
const clang::CXXRecordDecl::DefinitionData& clang::CXXRecordDecl::data() const:
Assertion `DefinitionData && "queried property of class with no definition"'
failed.
0  clang           0x00000000033fea9f llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang           0x00000000033fed1c
2  clang           0x00000000033fe785
3  libpthread.so.0 0x00007f87d4f2fcb0
4  libc.so.6       0x00007f87d4267425 gsignal + 53
5  libc.so.6       0x00007f87d426ab8b abort + 379
6  libc.so.6       0x00007f87d42600ee
7  libc.so.6       0x00007f87d4260192
8  clang           0x0000000000eae1ae
9  clang           0x0000000000f7e314
10 clang           0x000000000206ea2b clang::CXXRecordDecl::forallBases(bool
(*)(clang::CXXRecordDecl const*, void*), void*, bool) const + 83
11 clang           0x0000000001498d41
12 clang           0x000000000149917b
13 clang           0x0000000001499604
clang::Sema::BuildPossibleImplicitMemberExpr(clang::CXXScopeSpec const&,
clang::SourceLocation, clang::LookupResult&, clang::TemplateArgumentListInfo
const*) + 58
14 clang           0x00000000012be3dc clang::Sema::ClassifyName(clang::Scope*,
clang::CXXScopeSpec&, clang::IdentifierInfo*&, clang::SourceLocation,
clang::Token const&, bool, clang::CorrectionCandidateCallback*) + 4512
15 clang           0x000000000118d918 clang::Parser::TryAnnotateName(bool,
clang::CorrectionCandidateCallback*) + 778
16 clang           0x00000000011eb293
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
+ 533
17 clang           0x00000000011ead2a
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 128
18 clang           0x00000000011ed957
clang::Parser::ParseCompoundStatementBody(bool) + 1139
19 clang           0x00000000011f37ae
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 322
20 clang           0x0000000001200338
clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) + 1368
21 clang           0x00000000011ff3f9
clang::Parser::LexedMethod::ParseLexedMethodDefs() + 35
22 clang           0x00000000011ffd94
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 274
23 clang           0x00000000011b8e31
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 3625
24 clang           0x00000000011b5250
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 7354
25 clang           0x00000000011a347e
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 8910
26 clang           0x000000000118b779
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 101
27 clang           0x000000000118bcbc
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 174
28 clang           0x000000000118b3dc
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2686
29 clang           0x000000000118a913
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 535
30 clang           0x0000000001182eff clang::ParseAST(clang::Sema&, bool, bool)
+ 396
31 clang           0x0000000000d0c46a clang::ASTFrontendAction::ExecuteAction()
+ 322
32 clang           0x0000000000d0bf9d clang::FrontendAction::Execute() + 205
33 clang           0x0000000000ce060c
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 720
34 clang           0x0000000000cad1a4
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1074
35 clang           0x0000000000c9eb95 cc1_main(char const**, char const**, char
const*, void*) + 636
36 clang           0x0000000000ca8cb4 main + 770
37 libc.so.6       0x00007f87d425276d __libc_start_main + 237
38 clang           0x0000000000c9d269
Stack dump:
0.    Program arguments:
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -fsyntax-only -disable-free -main-file-name 175.c
-mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.23.52.20130808 -resource-dir
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/../lib/clang/3.5
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/x86_64-linux-gnu/c++/4.6
-internal-isystem /usr/local/include -internal-isystem
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/../lib/clang/3.5/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir
/usr/local/google/home/nlewycky/delta-2006.08.03 -ferror-limit 19
-fmessage-length 80 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -x
c++ 175.c 
1.    175.c:6:7: current parser token 'count'
2.    175.c:1:1: parsing struct/union/class body 'X'
3.    175.c:5:39: parsing function body 'read'
4.    175.c:5:39: in compound statement ('{}')
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5 (trunk 199573) (llvm/trunk 192017:199573M)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/175-7028f9.cpp
clang: note: diagnostic msg: /tmp/175-7028f9.sh
clang: note: diagnostic msg: 

********************

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140119/9c99eb1b/attachment.html>


More information about the llvm-bugs mailing list