From: Larisse Voufo Date: Tue, 18 Jun 2013 03:08:53 +0000 (+0000) Subject: contextual conversion fix: C++98 compatibility warning. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=904df3e61a8043c60dc733933219a1e1466de5a6;p=clang contextual conversion fix: C++98 compatibility warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184167 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index d723c1fe77..a6b6e36bb7 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -1194,7 +1194,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, // enumeration type, or a class type for which a single non-explicit // conversion function to integral or unscoped enumeration type exists. // C++1y [expr.new]p6: The expression [...] is implicitly converted to - // std::size_t. (FIXME) + // std::size_t. if (ArraySize && !ArraySize->isTypeDependent()) { ExprResult ConvertedSize; if (getLangOpts().CPlusPlus1y) { @@ -1204,7 +1204,8 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, ConvertedSize = PerformImplicitConversion(ArraySize, Context.getSizeType(), AA_Converting); - if (!isSFINAEContext()) + if (!ConvertedSize.isInvalid() && + ArraySize->getType()->getAs()) // Diagnose the compatibility of this conversion. Diag(StartLoc, diag::warn_cxx98_compat_array_size_conversion) << ArraySize->getType() << 0 << "'size_t'";