<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Crash with dependent type in template"
   href="https://bugs.llvm.org/show_bug.cgi?id=38347">38347</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash with dependent type in template
          </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>enhancement
          </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>v.reichelt@netcologne.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Clang crashes on the following valid code snippet:

====================================
template<typename> struct A
{
  struct B { typedef A X; };
};

template<typename T> struct C
{
  struct A<T>::B::X x;
};

C<int> c;
====================================

clang-7: /tmp/LLVM/llvm/tools/clang/include/clang/AST/TypeNodes.def:106:
clang::TypeInfo clang::ASTContext::getTypeInfoImpl(const clang::Type*) const:
Assertion `!T->isDependentType() && "should not see dependent types here"'
failed.

Stack dump:
1.      <eof> parser at end of file
2.      fPR34487A.cc:17:8: LLVM IR generation of declaration 'c'
3.      fPR34487A.cc:17:8: Generating code for declaration 'c'

#8 0x0000000003c2a339 clang::ASTContext::getTypeInfoImpl(clang::Type const*)
const (LLVM/bin/clang-7+0x3c2a339)
#9 0x0000000003c26037 clang::ASTContext::getTypeInfo(clang::Type const*) const
(LLVM/bin/clang-7+0x3c26037)
#10 0x0000000003c29475 clang::ASTContext::getTypeInfoInChars(clang::Type
const*) const (LLVM/bin/clang-7+0x3c29475)
#11 0x0000000003c29502 clang::ASTContext::getTypeInfoInChars(clang::QualType)
const (LLVM/bin/clang-7+0x3c29502)
#12 0x0000000003dd6a31 (anonymous
namespace)::ItaniumRecordLayoutBuilder::LayoutField(clang::FieldDecl const*,
bool) (LLVM/bin/clang-7+0x3dd6a31)
#13 0x0000000003dd7546 (anonymous
namespace)::ItaniumRecordLayoutBuilder::LayoutFields(clang::RecordDecl const*)
(LLVM/bin/clang-7+0x3dd7546)
#14 0x0000000003dd2713 clang::ASTContext::getASTRecordLayout(clang::RecordDecl
const*) const (LLVM/bin/clang-7+0x3dd2713)
#15 0x00000000025e26f0 (anonymous
namespace)::CGRecordLowering::CGRecordLowering(clang::CodeGen::CodeGenTypes&,
clang::RecordDecl const*, bool) (LLVM/bin/clang-7+0x25e26f0)
#16 0x00000000025e7c7f
clang::CodeGen::CodeGenTypes::ComputeRecordLayout(clang::RecordDecl const*,
llvm::StructType*) (LLVM/bin/clang-7+0x25e7c7f)
#17 0x00000000026960e6
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(clang::RecordDecl const*)
(LLVM/bin/clang-7+0x26960e6)
#18 0x000000000269742b
clang::CodeGen::CodeGenTypes::getCGRecordLayout(clang::RecordDecl const*)
(LLVM/bin/clang-7+0x269742b)
#19 0x00000000026974c9
clang::CodeGen::CodeGenTypes::isZeroInitializable(clang::RecordDecl const*)
(LLVM/bin/clang-7+0x26974c9)
#20 0x00000000025d8472
clang::CodeGen::CodeGenModule::EmitNullConstant(clang::QualType)
(LLVM/bin/clang-7+0x25d8472)
#21 0x00000000025deeb3
clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(clang::VarDecl
const&) (LLVM/bin/clang-7+0x25deeb3)
#22 0x00000000025df088
clang::CodeGen::ConstantEmitter::tryEmitForInitializer(clang::VarDecl const&)
(LLVM/bin/clang-7+0x25df088)
#23 0x000000000265c523
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl const*,
bool) (LLVM/bin/clang-7+0x265c523)
#24 0x00000000026755e1
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (LLVM/bin/clang-7+0x26755e1)
#25 0x0000000002676750
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(LLVM/bin/clang-7+0x2676750)
#26 0x0000000002676cec
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.6636)
(LLVM/bin/clang-7+0x2676cec)
#27 0x0000000002d11243 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(LLVM/bin/clang-7+0x2d11243)
#28 0x0000000002d0b75d
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(LLVM/bin/clang-7+0x2d0b75d)
#29 0x000000000343bcc6 clang::ParseAST(clang::Sema&, bool, bool)
(LLVM/bin/clang-7+0x343bcc6)
#30 0x0000000002d0f5cf clang::CodeGenAction::ExecuteAction()
(LLVM/bin/clang-7+0x2d0f5cf)
#31 0x00000000029c1b96 clang::FrontendAction::Execute()
(LLVM/bin/clang-7+0x29c1b96)
#32 0x000000000299682e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(LLVM/bin/clang-7+0x299682e)
#33 0x0000000002a5e582
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(LLVM/bin/clang-7+0x2a5e582)

clang version 7.0.0 (trunk)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /LLVM/bin</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>