But it is in the underlying c part of clang. clang crashes
in IRGen when passing an incomplete type argument to
variadic function (instead of diagnosing the bug).
// rdar://
10961370
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151862
91177308-0d34-0410-b5e6-
96231b3b80d8
E = Comma.get();
}
}
+ // c++ rules are enfroced elsewhere.
+ if (!getLangOptions().CPlusPlus &&
+ !E->getType()->isVoidType() &&
+ RequireCompleteType(E->getExprLoc(), E->getType(),
+ diag::err_incomplete_type))
+ return ExprError();
return Owned(E);
}
--- /dev/null
+// RUN: %clang_cc1 %s -fsyntax-only -verify
+// rdar://10961370
+
+typedef struct __CFError * CFErrorRef; // expected-note {{forward declaration of 'struct __CFError'}}
+
+void junk(int, ...);
+
+int main()
+{
+ CFErrorRef error;
+ junk(1, *error); // expected-error {{incomplete type 'struct __CFError' where a complete type is required}}
+}