================
Comment at: llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:367-379
@@ -366,1 +366,15 @@
 
+  if (D->getInit() && !InstantiatingVarTemplate) {
+    const Expr* Arg = D->getInit();
+    const InitListExpr *ILE = dyn_cast<InitListExpr>(Arg);
+    if(!ILE || (ILE && !ILE->isStringLiteralInit() && ILE->getNumInits() == 0 
)) {
+      if (D->getType()->isIncompleteType() || 
D->getType()->isIncompleteOrObjectType() ) {
+        if (SemaRef.RequireCompleteType(Var->getLocation(),
+                Var->getType(), 
diag::err_typecheck_incomplete_array_needs_initializer)) {
+          Var->setInvalidDecl();
+          return 0;
+        }
+      }
+    }
+  }
+
----------------
This check belongs in SemaInit.


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

Reply via email to