[LLVMbugs] [Bug 16061] New: assertion "do deletion after instantiation"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 17 15:53:36 PDT 2013


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

            Bug ID: 16061
           Summary: assertion "do deletion after instantiation"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            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

$ cat b8448807.cc
struct X { X(); };

template<typename T> struct Test {
  union {
    struct {
      X x;
    };
  };
}

with -std=gnu++11 causes this crash:

clang: SemaDeclCXX.cpp:4942: bool
clang::Sema::ShouldDeleteSpecialMember(clang::CXXMethodDecl*,
clang::Sema::CXXSpecialMember, bool): Assertion `!RD->isDependentType() && "do
deletion after instantiation"' failed.
0  clang           0x0000000003093462 llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang           0x00000000030936e9
2  clang           0x0000000003093138
3  libpthread.so.0 0x00007f3af75ebcb0
4  libc.so.6       0x00007f3af683d425 gsignal + 53
5  libc.so.6       0x00007f3af6840b8b abort + 379
6  libc.so.6       0x00007f3af68360ee
7  libc.so.6       0x00007f3af6836192
8  clang           0x000000000133cabb
clang::Sema::ShouldDeleteSpecialMember(clang::CXXMethodDecl*,
clang::Sema::CXXSpecialMember, bool) + 137
9  clang           0x0000000001347570
clang::Sema::DeclareImplicitDefaultConstructor(clang::CXXRecordDecl*) + 664
10 clang           0x000000000133d255
11 clang           0x000000000133d677
12 clang           0x000000000133dddd
clang::Sema::DiagnoseNontrivial(clang::CXXRecordDecl const*,
clang::Sema::CXXSpecialMember) + 115
13 clang           0x00000000012f3425
clang::Sema::CheckNontrivialField(clang::FieldDecl*) + 937
14 clang           0x00000000012d597c
clang::Sema::BuildAnonymousStructOrUnion(clang::Scope*, clang::DeclSpec&,
clang::AccessSpecifier, clang::RecordDecl*) + 2532
15 clang           0x00000000012d400e
clang::Sema::ParsedFreeStandingDeclSpec(clang::Scope*, clang::AccessSpecifier,
clang::DeclSpec&, llvm::MutableArrayRef<clang::TemplateParameterList*>, bool) +
1566
16 clang           0x00000000011d465d
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 2377
17 clang           0x00000000011d693b
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 2899
18 clang           0x00000000011d2ef6
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 7978
19 clang           0x00000000011bec61
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 8343
20 clang           0x0000000001214083
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 439
21 clang           0x0000000001213e67
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1083
22 clang           0x0000000001213a12
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 214
23 clang           0x00000000011b9841
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 239
24 clang           0x00000000011a79ca
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1680
25 clang           0x00000000011a7309
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 415
26 clang           0x00000000011a3bd9 clang::ParseAST(clang::Sema&, bool, bool)
+ 597
27 clang           0x0000000000d78ec6 clang::ASTFrontendAction::ExecuteAction()
+ 298
28 clang           0x0000000000fb6a80 clang::CodeGenAction::ExecuteAction() +
1414
29 clang           0x0000000000d78a48 clang::FrontendAction::Execute() + 200
30 clang           0x0000000000d4bb64
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 720
31 clang           0x0000000000d1b200
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1018
32 clang           0x0000000000d0b00b cc1_main(char const**, char const**, char
const*, void*) + 717
33 clang           0x0000000000d157ab main + 496
34 libc.so.6       0x00007f3af682876d __libc_start_main + 237
35 clang           0x0000000000d0a6e9
Stack dump:
0.      Program arguments:
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
b8448807.cc -mrelocation-model static -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64
-target-linker-version 2.22 -resource-dir
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/../lib/clang/3.4
-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.4/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir
/usr/local/google/home/nlewycky -ferror-limit 19 -fmessage-length 80
-mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-backend-option -vectorize-loops -o /tmp/b8448807-iUHhLZ.o -x c++ b8448807.cc 
1.      b8448807.cc:9:1: current parser token '}'
2.      b8448807.cc:3:22: parsing struct/union/class body 'Test'
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.4 (trunk 181651)
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.

-- 
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/20130517/ba04225b/attachment.html>


More information about the llvm-bugs mailing list