Switch PerformImplicitConversion over to use DefaultLvalueConversion for lvalue-to-rvalue conversion.
llvm-svn: 148874
This commit is contained in:
parent
78536ae5b5
commit
946b7b5bc8
|
@ -2324,12 +2324,14 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ICK_Lvalue_To_Rvalue:
|
case ICK_Lvalue_To_Rvalue: {
|
||||||
assert(From->getObjectKind() != OK_ObjCProperty);
|
assert(From->getObjectKind() != OK_ObjCProperty);
|
||||||
FromType = FromType.getUnqualifiedType();
|
FromType = FromType.getUnqualifiedType();
|
||||||
From = ImplicitCastExpr::Create(Context, FromType, CK_LValueToRValue,
|
ExprResult FromRes = DefaultLvalueConversion(From);
|
||||||
From, 0, VK_RValue);
|
assert(!FromRes.isInvalid() && "Can't perform deduced conversion?!");
|
||||||
|
From = FromRes.take();
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case ICK_Array_To_Pointer:
|
case ICK_Array_To_Pointer:
|
||||||
FromType = Context.getArrayDecayedType(FromType);
|
FromType = Context.getArrayDecayedType(FromType);
|
||||||
|
|
|
@ -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
|
// XFAIL
|
||||||
|
|
||||||
typedef typeof(sizeof(int)) size_t;
|
typedef typeof(sizeof(int)) size_t;
|
||||||
|
|
Loading…
Reference in New Issue