r184167 - contextual conversion fix: C++98 compatibility warning.
Larisse Voufo
lvoufo at google.com
Mon Jun 17 20:08:53 PDT 2013
Author: lvoufo
Date: Mon Jun 17 22:08:53 2013
New Revision: 184167
URL: http://llvm.org/viewvc/llvm-project?rev=184167&view=rev
Log:
contextual conversion fix: C++98 compatibility warning.
Modified:
cfe/trunk/lib/Sema/SemaExprCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=184167&r1=184166&r2=184167&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Mon Jun 17 22:08:53 2013
@@ -1194,7 +1194,7 @@ Sema::BuildCXXNew(SourceRange Range, boo
// 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, boo
ConvertedSize = PerformImplicitConversion(ArraySize, Context.getSizeType(),
AA_Converting);
- if (!isSFINAEContext())
+ if (!ConvertedSize.isInvalid() &&
+ ArraySize->getType()->getAs<RecordType>())
// Diagnose the compatibility of this conversion.
Diag(StartLoc, diag::warn_cxx98_compat_array_size_conversion)
<< ArraySize->getType() << 0 << "'size_t'";
More information about the cfe-commits
mailing list