[flang] Added the machinery for REAL DO controls to be treated as a separate

extension.

Original-commit: flang-compiler/f18@1907cf8672
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
This commit is contained in:
Peter Steinfeld 2019-06-05 14:34:25 -07:00
parent a698d3d579
commit 0bef67225a
2 changed files with 7 additions and 4 deletions

View File

@ -30,7 +30,8 @@ ENUM_CLASS(LanguageFeature, BackslashEscapes, OldDebugLines,
Convert, Dispose, IOListLeadingComma, AbbreviatedEditDescriptor,
ProgramParentheses, PercentRefAndVal, OmitFunctionDummies, CrayPointer,
Hollerith, ArithmeticIF, Assign, AssignedGOTO, Pause, OpenMP,
CruftAfterAmpersand, ClassicCComments, AdditionalFormats, BigIntLiterals)
CruftAfterAmpersand, ClassicCComments, AdditionalFormats, BigIntLiterals,
RealDoControls)
using LanguageFeatures =
common::EnumSet<LanguageFeature, LanguageFeature_enumSize>;

View File

@ -398,10 +398,12 @@ private:
}
void CheckDoControl(parser::CharBlock sourceLocation, bool isReal) {
if ((isReal) && (!context_.warnOnNonstandardUsage())) {
bool warn = context_.warnOnNonstandardUsage() ||
context_.ShouldWarn(parser::LanguageFeature::RealDoControls);
bool enabled = context_.IsEnabled(parser::LanguageFeature::RealDoControls);
if (isReal && enabled && !(warn)) {
// No messages for the default case
} else if (isReal && context_.warnOnNonstandardUsage() &&
(!context_.warningsAreErrors())) {
} else if (isReal && enabled && warn && !context_.warningsAreErrors()) {
context_.Say(sourceLocation, "DO controls should be INTEGER"_en_US);
} else {
context_.Say(sourceLocation, "DO controls should be INTEGER"_err_en_US);