<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - assertion "do deletion after instantiation""
   href="http://llvm.org/bugs/show_bug.cgi?id=16061">16061</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>assertion "do deletion after instantiation"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nlewycky@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ 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
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>