The following code will crash clang trunk (r117648): template <int i> 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.
also cloned to <rdar://problem/8611125>
Fixed at r118235.