compiler crash with forward declarations and templates #8877
Labels
bugzilla
Issues migrated from bugzilla
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Extended Description
The following code will crash clang trunk (r117648):
template class A {
class B* g;
};
class B {
void f () {}
};
template class A<0>;
Output:
clang: /home/steffen/prog/llvm/tools/clang/lib/Sema/../../include/clang/AST/DependentDiagnostic.h:178: clang::DeclContext::ddiag_iterator clang::DeclContext::ddiag_begin() const: Assertion `isDependentContext() && "cannot iterate dependent diagnostics of non-dependent context"' failed.
Adding "class B;" at the start of the source file will fix the problem.
The text was updated successfully, but these errors were encountered: