Please add a testcase that uses a forward declaration and then defines it, such 
as:

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

I think a case like that will still assert with your current patch (because `x` 
is not an incomplete type, but it won't have had a declaration instantiated 
when we instantiate the declaration of `g`).


================
Comment at: lib/Sema/SemaTemplateInstantiate.cpp:2802
@@ +2801,3 @@
+  if (const TagDecl *TD = dyn_cast<TagDecl>(D))
+    if (TD->getTypeForDecl()->isIncompleteType())
+      return nullptr;
----------------
This should use the same condition as the other change.

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