@@ -5504,6 +5504,7 @@ enum class ParamSpecifier : uint8_t {
55045504class ParamDecl : public VarDecl {
55055505 friend class DefaultArgumentInitContextRequest ;
55065506 friend class DefaultArgumentExprRequest ;
5507+ friend class DefaultArgumentTypeRequest ;
55075508
55085509 enum class ArgumentNameFlags : uint8_t {
55095510 // / Whether or not this parameter is destructed.
@@ -5524,6 +5525,9 @@ class ParamDecl : public VarDecl {
55245525 struct alignas (1 << StoredDefaultArgumentAlignInBits) StoredDefaultArgument {
55255526 PointerUnion<Expr *, VarDecl *> DefaultArg;
55265527
5528+ // / The type of the default argument expression.
5529+ Type ExprType;
5530+
55275531 // / Stores the context for the default argument as well as a bit to
55285532 // / indicate whether the default expression has been type-checked.
55295533 llvm::PointerIntPair<Initializer *, 1 , bool > InitContextAndIsTypeChecked;
@@ -5641,6 +5645,10 @@ class ParamDecl : public VarDecl {
56415645 return nullptr ;
56425646 }
56435647
5648+ // / Retrieve the type of the default expression (if any) associated with
5649+ // / this parameter declaration.
5650+ Type getTypeOfDefaultExpr () const ;
5651+
56445652 VarDecl *getStoredProperty () const {
56455653 if (auto stored = DefaultValueAndFlags.getPointer ())
56465654 return stored->DefaultArg .dyn_cast <VarDecl *>();
@@ -5655,6 +5663,10 @@ class ParamDecl : public VarDecl {
56555663 // / parameter's fully type-checked default argument.
56565664 void setDefaultExpr (Expr *E, bool isTypeChecked);
56575665
5666+ // / Sets a type of default expression associated with this parameter.
5667+ // / This should only be called by deserialization.
5668+ void setDefaultExprType (Type type);
5669+
56585670 void setStoredProperty (VarDecl *var);
56595671
56605672 // / Retrieve the initializer context for the parameter's default argument.
0 commit comments