@@ -833,8 +833,6 @@ class Sema final : public SemaBase {
833833 /// Warn when implicitly casting 0 to nullptr.
834834 void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E);
835835
836- // ----- function effects ---
837-
838836 /// All functions/lambdas/blocks which have bodies and which have a non-empty
839837 /// FunctionEffectsRef to be verified.
840838 SmallVector<const Decl *> DeclsWithEffectsToVerify;
@@ -846,30 +844,6 @@ class Sema final : public SemaBase {
846844 void diagnoseFunctionEffectConversion(QualType DstType, QualType SrcType,
847845 SourceLocation Loc);
848846
849- /// Warn and return true if adding an effect to a set would create a conflict.
850- bool diagnoseConflictingFunctionEffect(const FunctionEffectsRef &FX,
851- const FunctionEffectWithCondition &EC,
852- SourceLocation NewAttrLoc);
853-
854- // Report a failure to merge function effects between declarations due to a
855- // conflict.
856- void
857- diagnoseFunctionEffectMergeConflicts(const FunctionEffectSet::Conflicts &Errs,
858- SourceLocation NewLoc,
859- SourceLocation OldLoc);
860-
861- /// Potentially add a FunctionDecl or BlockDecl to DeclsWithEffectsToVerify.
862- void maybeAddDeclWithEffects(const Decl *D, const FunctionEffectsRef &FX);
863-
864- /// Unconditionally add a Decl to DeclsWithEfffectsToVerify.
865- void addDeclWithEffects(const Decl *D, const FunctionEffectsRef &FX);
866-
867- /// Try to parse the conditional expression attached to an effect attribute
868- /// (e.g. 'nonblocking'). (c.f. Sema::ActOnNoexceptSpec). Return an empty
869- /// optional on error.
870- std::optional<FunctionEffectMode>
871- ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName);
872-
873847 /// makeUnavailableInSystemHeader - There is an error in the current
874848 /// context. If we're still in a system header, and we can plausibly
875849 /// make the relevant declaration unavailable instead of erroring, do
@@ -4359,6 +4333,24 @@ class Sema final : public SemaBase {
43594333 // Whether the callee should be ignored in CUDA/HIP/OpenMP host/device check.
43604334 bool shouldIgnoreInHostDeviceCheck(FunctionDecl *Callee);
43614335
4336+ /// Warn and return true if adding a function effect to a set would create a conflict.
4337+ bool diagnoseConflictingFunctionEffect(const FunctionEffectsRef &FX,
4338+ const FunctionEffectWithCondition &EC,
4339+ SourceLocation NewAttrLoc);
4340+
4341+ // Report a failure to merge function effects between declarations due to a
4342+ // conflict.
4343+ void
4344+ diagnoseFunctionEffectMergeConflicts(const FunctionEffectSet::Conflicts &Errs,
4345+ SourceLocation NewLoc,
4346+ SourceLocation OldLoc);
4347+
4348+ /// Potentially add a FunctionDecl or BlockDecl to DeclsWithEffectsToVerify.
4349+ void maybeAddDeclWithEffects(const Decl *D, const FunctionEffectsRef &FX);
4350+
4351+ /// Unconditionally add a Decl to DeclsWithEfffectsToVerify.
4352+ void addDeclWithEffects(const Decl *D, const FunctionEffectsRef &FX);
4353+
43624354private:
43634355 /// Function or variable declarations to be checked for whether the deferred
43644356 /// diagnostics should be emitted.
@@ -15047,6 +15039,12 @@ class Sema final : public SemaBase {
1504715039 return hasAcceptableDefinition(D, &Hidden, Kind);
1504815040 }
1504915041
15042+ /// Try to parse the conditional expression attached to an effect attribute
15043+ /// (e.g. 'nonblocking'). (c.f. Sema::ActOnNoexceptSpec). Return an empty
15044+ /// optional on error.
15045+ std::optional<FunctionEffectMode>
15046+ ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName);
15047+
1505015048private:
1505115049 /// The implementation of RequireCompleteType
1505215050 bool RequireCompleteTypeImpl(SourceLocation Loc, QualType T,
0 commit comments