@@ -873,8 +873,6 @@ class Sema final : public SemaBase {
873873 /// Warn when implicitly casting 0 to nullptr.
874874 void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E);
875875
876- // ----- function effects ---
877-
878876 /// All functions/lambdas/blocks which have bodies and which have a non-empty
879877 /// FunctionEffectsRef to be verified.
880878 SmallVector<const Decl *> DeclsWithEffectsToVerify;
@@ -886,30 +884,6 @@ class Sema final : public SemaBase {
886884 void diagnoseFunctionEffectConversion(QualType DstType, QualType SrcType,
887885 SourceLocation Loc);
888886
889- /// Warn and return true if adding an effect to a set would create a conflict.
890- bool diagnoseConflictingFunctionEffect(const FunctionEffectsRef &FX,
891- const FunctionEffectWithCondition &EC,
892- SourceLocation NewAttrLoc);
893-
894- // Report a failure to merge function effects between declarations due to a
895- // conflict.
896- void
897- diagnoseFunctionEffectMergeConflicts(const FunctionEffectSet::Conflicts &Errs,
898- SourceLocation NewLoc,
899- SourceLocation OldLoc);
900-
901- /// Potentially add a FunctionDecl or BlockDecl to DeclsWithEffectsToVerify.
902- void maybeAddDeclWithEffects(const Decl *D, const FunctionEffectsRef &FX);
903-
904- /// Unconditionally add a Decl to DeclsWithEfffectsToVerify.
905- void addDeclWithEffects(const Decl *D, const FunctionEffectsRef &FX);
906-
907- /// Try to parse the conditional expression attached to an effect attribute
908- /// (e.g. 'nonblocking'). (c.f. Sema::ActOnNoexceptSpec). Return an empty
909- /// optional on error.
910- std::optional<FunctionEffectMode>
911- ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName);
912-
913887 /// makeUnavailableInSystemHeader - There is an error in the current
914888 /// context. If we're still in a system header, and we can plausibly
915889 /// make the relevant declaration unavailable instead of erroring, do
@@ -4343,6 +4317,24 @@ class Sema final : public SemaBase {
43434317 // Whether the callee should be ignored in CUDA/HIP/OpenMP host/device check.
43444318 bool shouldIgnoreInHostDeviceCheck(FunctionDecl *Callee);
43454319
4320+ /// Warn and return true if adding a function effect to a set would create a conflict.
4321+ bool diagnoseConflictingFunctionEffect(const FunctionEffectsRef &FX,
4322+ const FunctionEffectWithCondition &EC,
4323+ SourceLocation NewAttrLoc);
4324+
4325+ // Report a failure to merge function effects between declarations due to a
4326+ // conflict.
4327+ void
4328+ diagnoseFunctionEffectMergeConflicts(const FunctionEffectSet::Conflicts &Errs,
4329+ SourceLocation NewLoc,
4330+ SourceLocation OldLoc);
4331+
4332+ /// Potentially add a FunctionDecl or BlockDecl to DeclsWithEffectsToVerify.
4333+ void maybeAddDeclWithEffects(const Decl *D, const FunctionEffectsRef &FX);
4334+
4335+ /// Unconditionally add a Decl to DeclsWithEfffectsToVerify.
4336+ void addDeclWithEffects(const Decl *D, const FunctionEffectsRef &FX);
4337+
43464338private:
43474339 /// Function or variable declarations to be checked for whether the deferred
43484340 /// diagnostics should be emitted.
@@ -15015,6 +15007,12 @@ class Sema final : public SemaBase {
1501515007 return hasAcceptableDefinition(D, &Hidden, Kind);
1501615008 }
1501715009
15010+ /// Try to parse the conditional expression attached to an effect attribute
15011+ /// (e.g. 'nonblocking'). (c.f. Sema::ActOnNoexceptSpec). Return an empty
15012+ /// optional on error.
15013+ std::optional<FunctionEffectMode>
15014+ ActOnEffectExpression(Expr *CondExpr, StringRef AttributeName);
15015+
1501815016private:
1501915017 /// The implementation of RequireCompleteType
1502015018 bool RequireCompleteTypeImpl(SourceLocation Loc, QualType T,
0 commit comments