diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-07-30 06:45:27 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-07-30 06:45:27 +0000 |
commit | 7e1eb935dbc3560e05761de521f379736d0a3a6f (patch) | |
tree | 5ad2acb13808b1ef275fff4f9554c5fd18c2881f /clang/lib/Sema | |
parent | d8575e1e1deb5a980d3fd6d2b6505b3f4ae23c84 (diff) | |
download | bcm5719-llvm-7e1eb935dbc3560e05761de521f379736d0a3a6f.tar.gz bcm5719-llvm-7e1eb935dbc3560e05761de521f379736d0a3a6f.zip |
When complaining about a non-POD second argument to va_arg, use a
special diagnostic for ARC ownership-qualified types. We wouldn't want
to expose Objective-C programmers to the term "POD", would we? Fixes
<rdar://problem/9772982>.
llvm-svn: 136558
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index bfaf5460361..966fcbffcf2 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -8591,11 +8591,14 @@ ExprResult Sema::BuildVAArgExpr(SourceLocation BuiltinLoc, << TInfo->getTypeLoc().getSourceRange())) return ExprError(); - if (!TInfo->getType().isPODType(Context)) + if (!TInfo->getType().isPODType(Context)) { Diag(TInfo->getTypeLoc().getBeginLoc(), - diag::warn_second_parameter_to_va_arg_not_pod) + TInfo->getType()->isObjCLifetimeType() + ? diag::warn_second_parameter_to_va_arg_ownership_qualified + : diag::warn_second_parameter_to_va_arg_not_pod) << TInfo->getType() << TInfo->getTypeLoc().getSourceRange(); + } // Check for va_arg where arguments of the given type will be promoted // (i.e. this va_arg is guaranteed to have undefined behavior). |