Switch PerformImplicitConversion over to use DefaultLvalueConversion for lvalue-to-rvalue conversion.

llvm-svn: 148874
This commit is contained in:
Eli Friedman 2012-01-24 22:51:26 +00:00
parent 78536ae5b5
commit 946b7b5bc8
2 changed files with 6 additions and 4 deletions

View File

@ -2324,12 +2324,14 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
// Nothing to do.
break;
case ICK_Lvalue_To_Rvalue:
case ICK_Lvalue_To_Rvalue: {
assert(From->getObjectKind() != OK_ObjCProperty);
FromType = FromType.getUnqualifiedType();
From = ImplicitCastExpr::Create(Context, FromType, CK_LValueToRValue,
From, 0, VK_RValue);
ExprResult FromRes = DefaultLvalueConversion(From);
assert(!FromRes.isInvalid() && "Can't perform deduced conversion?!");
From = FromRes.take();
break;
}
case ICK_Array_To_Pointer:
FromType = Context.getArrayDecayedType(FromType);

View File

@ -1,4 +1,4 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range -verify %s
// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range -verify -Wno-null-dereference %s
// XFAIL
typedef typeof(sizeof(int)) size_t;