// RUN: %clang_cc1 -S -emit-llvm -g %s -o - -triple=x86_64-unknown-unknown | FileCheck %s template struct a { }; extern template class a; // CHECK-NOT: ; [ DW_TAG_structure_type ] [a] template struct b { }; extern template class b; b bi; // CHECK: ; [ DW_TAG_structure_type ] [b] {{.*}} [def] template struct c { void f() {} }; extern template class c; c ci; // CHECK: ; [ DW_TAG_structure_type ] [c] {{.*}} [decl] template struct d { void f(); }; extern template class d; d di; // CHECK: ; [ DW_TAG_structure_type ] [d] {{.*}} [def] template struct e { void f(); }; template void e::f() { } extern template class e; e ei; // CHECK: ; [ DW_TAG_structure_type ] [e] {{.*}} [decl] template struct f { void g(); }; extern template class f; template void f::g() { } f fi; // Is this right? We don't seem to emit a def for 'f::g' (even if it is // called in this translation unit) so I guess if we're relying on its // definition to be wherever the explicit instantiation definition is, we can do // the same for the debug info. // CHECK: ; [ DW_TAG_structure_type ] [f] {{.*}} [decl] template struct g { void f(); }; template <> void g::f(); extern template class g; g gi; // CHECK: ; [ DW_TAG_structure_type ] [g] {{.*}} [def] template struct h { }; template class h; // CHECK: ; [ DW_TAG_structure_type ] [h] {{.*}} [def]