diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-18 20:49:44 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-18 20:49:44 +0000 |
commit | ebaf0e6ab743394dda086a01b457838cb6e589a8 (patch) | |
tree | 731d496e1c1d0b3247aea91eaf79c4aee5be86fc /lib/Sema/SemaExpr.cpp | |
parent | 024f4be866d13dd2b0ec062e694a62ca84c37191 (diff) |
-Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 549939e1c2..d3a8ff95d2 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -562,8 +562,12 @@ ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT, if (CXXRecordDecl *Record = E->getType()->getAsCXXRecordDecl()) { if (Record->hasTrivialCopyConstructor() && Record->hasTrivialMoveConstructor() && - Record->hasTrivialDestructor()) + Record->hasTrivialDestructor()) { + DiagRuntimeBehavior(E->getLocStart(), 0, + PDiag(diag::warn_cxx98_compat_pass_non_pod_arg_to_vararg) + << E->getType() << CT); TrivialEnough = true; + } } } @@ -2643,9 +2647,10 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok) { QualType Ty; // long long is a C99 feature. - if (!getLangOptions().C99 && !getLangOptions().CPlusPlus0x && - Literal.isLongLong) - Diag(Tok.getLocation(), diag::ext_longlong); + if (!getLangOptions().C99 && Literal.isLongLong) + Diag(Tok.getLocation(), + getLangOptions().CPlusPlus0x ? + diag::warn_cxx98_compat_longlong : diag::ext_longlong); // Get the value in the widest-possible width. llvm::APInt ResultVal(Context.getTargetInfo().getIntMaxTWidth(), 0); |