aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/dmd/dscope.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/dmd/dscope.d')
-rw-r--r--gcc/d/dmd/dscope.d10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/d/dmd/dscope.d b/gcc/d/dmd/dscope.d
index 76a26a2..4719529 100644
--- a/gcc/d/dmd/dscope.d
+++ b/gcc/d/dmd/dscope.d
@@ -830,12 +830,18 @@ extern (C++) struct Scope
/// Returns: whether to raise DIP1000 warnings (FeatureStabe.default) or errors (FeatureState.enabled)
extern (D) FeatureState useDIP1000()
{
- return (flags & SCOPE.dip1000) ? FeatureState.enabled : FeatureState.disabled;
+ return (flags & SCOPE.dip1000 || hasEdition(Edition.v2024)) ? FeatureState.enabled : FeatureState.disabled;
}
/// Returns: whether to raise DIP25 warnings (FeatureStabe.default) or errors (FeatureState.enabled)
extern (D) FeatureState useDIP25()
{
- return (flags & SCOPE.dip25) ? FeatureState.enabled : FeatureState.disabled;
+ return (flags & SCOPE.dip25 || hasEdition(Edition.v2024)) ? FeatureState.enabled : FeatureState.disabled;
+ }
+
+ /// Returns: whether this scope compiles with `edition` or later
+ extern (D) bool hasEdition(Edition edition)
+ {
+ return _module && _module.edition >= edition;
}
}