forked from OSchip/llvm-project
[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:
parent
a698d3d579
commit
0bef67225a
|
@ -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>;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue