Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/Sema.cpp
Show First 20 Lines • Show All 626 Lines • ▼ Show 20 Lines | #endif | ||||
QualType TypeTy = Context.getCanonicalType(Ty); | QualType TypeTy = Context.getCanonicalType(Ty); | ||||
if (ExprTy == TypeTy) | if (ExprTy == TypeTy) | ||||
return E; | return E; | ||||
if (Kind == CK_ArrayToPointerDecay) { | if (Kind == CK_ArrayToPointerDecay) { | ||||
// C++1z [conv.array]: The temporary materialization conversion is applied. | // C++1z [conv.array]: The temporary materialization conversion is applied. | ||||
// We also use this to fuel C++ DR1213, which applies to C++11 onwards. | // We also use this to fuel C++ DR1213, which applies to C++11 onwards. | ||||
if (getLangOpts().CPlusPlus && E->getValueKind() == VK_PRValue) { | if (getLangOpts().CPlusPlus && E->isPRValue()) { | ||||
// The temporary is an lvalue in C++98 and an xvalue otherwise. | // The temporary is an lvalue in C++98 and an xvalue otherwise. | ||||
ExprResult Materialized = CreateMaterializeTemporaryExpr( | ExprResult Materialized = CreateMaterializeTemporaryExpr( | ||||
E->getType(), E, !getLangOpts().CPlusPlus11); | E->getType(), E, !getLangOpts().CPlusPlus11); | ||||
if (Materialized.isInvalid()) | if (Materialized.isInvalid()) | ||||
return ExprError(); | return ExprError(); | ||||
E = Materialized.get(); | E = Materialized.get(); | ||||
} | } | ||||
// C17 6.7.1p6 footnote 124: The implementation can treat any register | // C17 6.7.1p6 footnote 124: The implementation can treat any register | ||||
▲ Show 20 Lines • Show All 1,894 Lines • Show Last 20 Lines |