* Character literals as elements of an array constructor without an explicit
type specifier need not have the same length; the longest literal determines
the length parameter of the implicit type, not the first.
+* Outside a character literal, a comment after a continuation marker (&)
+ need not begin with a comment marker (!).
Extensions supported when enabled by options
--------------------------------------------
OldStyleParameter, ComplexConstructor, PercentLOC, SignedPrimary, FileName,
Convert, Dispose, IOListLeadingComma, AbbreviatedEditDescriptor,
ProgramParentheses, PercentRefAndVal, OmitFunctionDummies, CrayPointer,
- Hollerith, ArithmeticIF, Assign, AssignedGOTO, Pause, OpenMP)
+ Hollerith, ArithmeticIF, Assign, AssignedGOTO, Pause, OpenMP,
+ CruftAfterAmpersand)
using LanguageFeatures =
common::EnumSet<LanguageFeature, LanguageFeature_enumSize>;
name, ", ONLY :" >> optionalList(Parser<Only>{})) ||
construct<UseStmt>("USE" >> optionalBeforeColons(moduleNature), name,
defaulted("," >>
- nonemptyList("expected renamings"_err_en_US, Parser<Rename>{}))))
+ nonemptyList("expected renamings"_err_en_US, Parser<Rename>{})) /
+ lookAhead(endOfStmt)))
// R1411 rename ->
// local-name => use-name |
if (*p != '\n') {
if (inCharLiteral_) {
return false;
- } else if (*p != '!') {
- Say(GetProvenance(p), "treated as comment after &"_en_US);
+ } else if (*p != '!' &&
+ features_.ShouldWarn(LanguageFeature::CruftAfterAmpersand)) {
+ Say(GetProvenance(p), "missing ! before comment after &"_en_US);
}
}
do {