summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-10-14 20:34:19 +0000
committerDouglas Gregor <dgregor@apple.com>2011-10-14 20:34:19 +0000
commit7e1aa5b7ac70bf6030d0a6727c979dd9d6781053 (patch)
tree0b82df00ba4d24cceda38561dcc24927e9434d48 /clang/lib/Sema/SemaExpr.cpp
parent96bd62f7692d953fd06eccd9cff64f17df818eed (diff)
downloadbcm5719-llvm-7e1aa5b7ac70bf6030d0a6727c979dd9d6781053.tar.gz
bcm5719-llvm-7e1aa5b7ac70bf6030d0a6727c979dd9d6781053.zip
Don't try to diagnose anything when we're passing incomplete types
through varargs. This only happens when we're in an unevaluated context, where we don't want to trigger an error anyway. Fixes PR11131 / <rdar://problem/10288375>. llvm-svn: 141986
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 97060772b0a..41fcf7299db 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -523,7 +523,10 @@ ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT,
<< E->getType() << CT))
return ExprError();
- if (!E->getType().isPODType(Context)) {
+ // Complain about passing non-POD types through varargs. However, don't
+ // perform this check for incomplete types, which we can get here when we're
+ // in an unevaluated context.
+ if (!E->getType()->isIncompleteType() && !E->getType().isPODType(Context)) {
// C++0x [expr.call]p7:
// Passing a potentially-evaluated argument of class type (Clause 9)
// having a non-trivial copy constructor, a non-trivial move constructor,
OpenPOWER on IntegriCloud