This looks like a good approach to me.

================
Comment at: lib/Sema/SemaTemplateInstantiate.cpp:2797-2798
@@ +2796,4 @@
+  // may not have a chance to instantiate it.
+  if (const TypeDecl *TD = dyn_cast<TypeDecl>(D))
+    if (TD->getTypeForDecl()->isIncompleteType())
+      return nullptr;
----------------
I think this should only apply to `TagDecl`s. You should then instantiate if 
`!TD->isThisDeclarationADefiinition() && !TD->isFreeStanding()`. Ideally, the 
freestanding check would instead check `isEmbeddedInDeclarator`, but it looks 
like we don't instantiate the tag early enough for that to work in cases like

    template<typename T> void f() { void g(struct x); }
    template void f<int>();

http://reviews.llvm.org/D8281

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to