diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-03-01 23:42:00 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-03-01 23:42:00 +0000 |
commit | e853bb34ec1f86e12dcdaa9b5e782fac2117b08f (patch) | |
tree | f88460a48b6608f866fad173383e6f3e51bc0d63 /lib/Sema/SemaExpr.cpp | |
parent | 48a8cd9840bf38601d4c042e4cdefb2e065faa2c (diff) |
c/objc: problem originally reported as an objective-c bug.
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
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 149201192f..6deffa2abd 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -587,6 +587,12 @@ ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT, 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); } |