/// Perform a conversion adding _Atomic to a type.
SK_AtomicConversion,
- /// Perform a load from a glvalue, producing an rvalue.
- SK_LValueToRValue,
-
/// Perform an implicit conversion sequence.
SK_ConversionSequence,
/// type.
void AddAtomicConversionStep(QualType Ty);
- /// Add a new step that performs a load of the given type.
- ///
- /// Although the term "LValueToRValue" is conventional, this applies to both
- /// lvalues and xvalues.
- void AddLValueToRValueStep(QualType Ty);
-
/// Add a new step that applies an implicit conversion sequence.
void AddConversionSequenceStep(const ImplicitConversionSequence &ICS,
QualType T, bool TopLevelOfInitList = false);
case SK_QualificationConversionXValue:
case SK_QualificationConversionLValue:
case SK_AtomicConversion:
- case SK_LValueToRValue:
case SK_ListInitialization:
case SK_UnwrapInitList:
case SK_RewrapInitList:
Steps.push_back(S);
}
-void InitializationSequence::AddLValueToRValueStep(QualType Ty) {
- assert(!Ty.hasQualifiers() && "rvalues may not have qualifiers");
-
- Step S;
- S.Kind = SK_LValueToRValue;
- S.Type = Ty;
- Steps.push_back(S);
-}
-
void InitializationSequence::AddConversionSequenceStep(
const ImplicitConversionSequence &ICS, QualType T,
bool TopLevelOfInitList) {
case SK_QualificationConversionXValue:
case SK_QualificationConversionRValue:
case SK_AtomicConversion:
- case SK_LValueToRValue:
case SK_ConversionSequence:
case SK_ConversionSequenceNoNarrowing:
case SK_ListInitialization:
break;
}
- case SK_LValueToRValue: {
- assert(CurInit.get()->isGLValue() && "cannot load from a prvalue");
- // C++ [conv.lval]p3:
- // If T is cv std::nullptr_t, the result is a null pointer constant.
- CastKind CK =
- Step->Type->isNullPtrType() ? CK_NullToPointer : CK_LValueToRValue;
- CurInit =
- ImplicitCastExpr::Create(S.Context, Step->Type, CK, CurInit.get(),
- /*BasePath=*/nullptr, VK_RValue);
- break;
- }
-
case SK_ConversionSequence:
case SK_ConversionSequenceNoNarrowing: {
if (const auto *FromPtrType =
OS << "non-atomic-to-atomic conversion";
break;
- case SK_LValueToRValue:
- OS << "load (lvalue to rvalue)";
- break;
-
case SK_ConversionSequence:
OS << "implicit conversion sequence (";
S->ICS->dump(); // FIXME: use OS