diff --git a/flang/include/flang/Parser/message.h b/flang/include/flang/Parser/message.h index e19b16c23b82b..7371a46ad36ce 100644 --- a/flang/include/flang/Parser/message.h +++ b/flang/include/flang/Parser/message.h @@ -292,7 +292,8 @@ class Message : public common::ReferenceCounted { std::optional GetProvenanceRange( const AllCookedSources &) const; void Emit(llvm::raw_ostream &, const AllCookedSources &, - bool echoSourceLine = true) const; + bool echoSourceLine = true, + const common::LanguageFeatureControl *hintFlags = nullptr) const; // If this Message or any of its attachments locates itself via a CharBlock, // replace its location with the corresponding ProvenanceRange. @@ -352,7 +353,8 @@ class Messages { void Copy(const Messages &); void ResolveProvenances(const AllCookedSources &); void Emit(llvm::raw_ostream &, const AllCookedSources &, - bool echoSourceLines = true) const; + bool echoSourceLines = true, + const common::LanguageFeatureControl *hintFlags = nullptr) const; void AttachTo(Message &, std::optional = std::nullopt); bool AnyFatalError() const; diff --git a/flang/include/flang/Support/Fortran-features.h b/flang/include/flang/Support/Fortran-features.h index 39356daa3606a..8a2b7b29a5233 100644 --- a/flang/include/flang/Support/Fortran-features.h +++ b/flang/include/flang/Support/Fortran-features.h @@ -156,14 +156,13 @@ class LanguageFeatureControl { private: // Map from Cli syntax of language features and usage warnings to their enum // values. - std::unordered_map> - cliOptions_; + std::unordered_map cliOptions_; // These two arrays map the enum values to their cannonical Cli spellings. // Since each of the CanonicalSpelling is a string in the domain of the map // above we just use a view of the string instead of another copy. - std::array + std::array languageFeatureCliCanonicalSpelling_; - std::array + std::array usageWarningCliCanonicalSpelling_; LanguageFeatures disable_; LanguageFeatures warnLanguage_; diff --git a/flang/lib/Frontend/FrontendAction.cpp b/flang/lib/Frontend/FrontendAction.cpp index d178fd6a9395d..5d788fe5619a2 100644 --- a/flang/lib/Frontend/FrontendAction.cpp +++ b/flang/lib/Frontend/FrontendAction.cpp @@ -171,7 +171,10 @@ bool FrontendAction::runParse(bool emitMessages) { if (emitMessages) { // Report any non-fatal diagnostics from getParsing now rather than // combining them with messages from semantics. - ci.getParsing().messages().Emit(llvm::errs(), ci.getAllCookedSources()); + const common::LanguageFeatureControl &features{ + ci.getInvocation().getFortranOpts().features}; + ci.getParsing().messages().Emit(llvm::errs(), ci.getAllCookedSources(), + /*echoSourceLine=*/true, &features); } return true; } @@ -223,6 +226,8 @@ bool FrontendAction::generateRtTypeTables() { template bool FrontendAction::reportFatalErrors(const char (&message)[N]) { + const common::LanguageFeatureControl &features{ + instance->getInvocation().getFortranOpts().features}; if (!instance->getParsing().messages().empty() && (instance->getInvocation().getWarnAsErr() || instance->getParsing().messages().AnyFatalError())) { @@ -230,7 +235,8 @@ bool FrontendAction::reportFatalErrors(const char (&message)[N]) { clang::DiagnosticsEngine::Error, message); instance->getDiagnostics().Report(diagID) << getCurrentFileOrBufferName(); instance->getParsing().messages().Emit(llvm::errs(), - instance->getAllCookedSources()); + instance->getAllCookedSources(), + /*echoSourceLines=*/true, &features); return true; } if (instance->getParsing().parseTree().has_value() && @@ -240,7 +246,8 @@ bool FrontendAction::reportFatalErrors(const char (&message)[N]) { clang::DiagnosticsEngine::Error, message); instance->getDiagnostics().Report(diagID) << getCurrentFileOrBufferName(); instance->getParsing().messages().Emit(llvm::errs(), - instance->getAllCookedSources()); + instance->getAllCookedSources(), + /*echoSourceLine=*/true, &features); instance->getParsing().EmitMessage( llvm::errs(), instance->getParsing().finalRestingPlace(), "parser FAIL (final position)", "error: ", llvm::raw_ostream::RED); diff --git a/flang/lib/Parser/message.cpp b/flang/lib/Parser/message.cpp index 799998c54b531..f2237da3857a2 100644 --- a/flang/lib/Parser/message.cpp +++ b/flang/lib/Parser/message.cpp @@ -273,14 +273,36 @@ static llvm::raw_ostream::Colors PrefixColor(Severity severity) { return llvm::raw_ostream::SAVEDCOLOR; } +static std::string HintLanguageControlFlag( + const common::LanguageFeatureControl *hintFlagPtr, + std::optional feature, + std::optional warning) { + if (hintFlagPtr) { + std::string flag; + if (warning) { + flag = hintFlagPtr->getDefaultCliSpelling(*warning); + } else if (feature) { + flag = hintFlagPtr->getDefaultCliSpelling(*feature); + } + if (!flag.empty()) { + return " [-W" + flag + "]"; + } + } + return ""; +} + static constexpr int MAX_CONTEXTS_EMITTED{2}; static constexpr bool OMIT_SHARED_CONTEXTS{true}; void Message::Emit(llvm::raw_ostream &o, const AllCookedSources &allCooked, - bool echoSourceLine) const { + bool echoSourceLine, + const common::LanguageFeatureControl *hintFlagPtr) const { std::optional provenanceRange{GetProvenanceRange(allCooked)}; const AllSources &sources{allCooked.allSources()}; - sources.EmitMessage(o, provenanceRange, ToString(), Prefix(severity()), + const std::string text{ToString()}; + const std::string hint{ + HintLanguageControlFlag(hintFlagPtr, languageFeature_, usageWarning_)}; + sources.EmitMessage(o, provenanceRange, text + hint, Prefix(severity()), PrefixColor(severity()), echoSourceLine); // Refers to whether the attachment in the loop below is a context, but can't // be declared inside the loop because the previous iteration's @@ -430,7 +452,8 @@ void Messages::ResolveProvenances(const AllCookedSources &allCooked) { } void Messages::Emit(llvm::raw_ostream &o, const AllCookedSources &allCooked, - bool echoSourceLines) const { + bool echoSourceLines, + const common::LanguageFeatureControl *hintFlagPtr) const { std::vector sorted; for (const auto &msg : messages_) { sorted.push_back(&msg); @@ -443,7 +466,7 @@ void Messages::Emit(llvm::raw_ostream &o, const AllCookedSources &allCooked, // Don't emit two identical messages for the same location continue; } - msg->Emit(o, allCooked, echoSourceLines); + msg->Emit(o, allCooked, echoSourceLines, hintFlagPtr); lastMsg = msg; } } diff --git a/flang/lib/Semantics/semantics.cpp b/flang/lib/Semantics/semantics.cpp index e07054f8ec564..ed41c6fb16892 100644 --- a/flang/lib/Semantics/semantics.cpp +++ b/flang/lib/Semantics/semantics.cpp @@ -655,8 +655,10 @@ bool Semantics::Perform() { void Semantics::EmitMessages(llvm::raw_ostream &os) { // Resolve the CharBlock locations of the Messages to ProvenanceRanges // so messages from parsing and semantics are intermixed in source order. + const common::LanguageFeatureControl &features{context_.languageFeatures()}; context_.messages().ResolveProvenances(context_.allCookedSources()); - context_.messages().Emit(os, context_.allCookedSources()); + context_.messages().Emit( + os, context_.allCookedSources(), /*echoSourceLine=*/true, &features); } void SemanticsContext::DumpSymbols(llvm::raw_ostream &os) { diff --git a/flang/lib/Support/Fortran-features.cpp b/flang/lib/Support/Fortran-features.cpp index 17b5f8368916d..fc69fc638eda1 100644 --- a/flang/lib/Support/Fortran-features.cpp +++ b/flang/lib/Support/Fortran-features.cpp @@ -59,7 +59,7 @@ LanguageFeatureControl::LanguageFeatureControl() { std::string cliOption{details::CamelCaseToLowerCaseHyphenated(name)}; cliOptions_.insert({cliOption, {feature}}); languageFeatureCliCanonicalSpelling_[EnumToInt(feature)] = - std::string_view{cliOption}; + std::move(cliOption); }); ForEachUsageWarning([&](auto warning) { @@ -67,7 +67,7 @@ LanguageFeatureControl::LanguageFeatureControl() { std::string cliOption{details::CamelCaseToLowerCaseHyphenated(name)}; cliOptions_.insert({cliOption, {warning}}); usageWarningCliCanonicalSpelling_[EnumToInt(warning)] = - std::string_view{cliOption}; + std::move(cliOption); }); // These features must be explicitly enabled by command line options. @@ -174,18 +174,16 @@ bool LanguageFeatureControl::EnableWarning(std::string_view input) { void LanguageFeatureControl::ReplaceCliCanonicalSpelling( LanguageFeature f, std::string input) { - std::string_view &old{languageFeatureCliCanonicalSpelling_[EnumToInt(f)]}; - cliOptions_.erase(std::string{old}); - languageFeatureCliCanonicalSpelling_[EnumToInt(f)] = input; + cliOptions_.erase(languageFeatureCliCanonicalSpelling_[EnumToInt(f)]); cliOptions_.insert({input, {f}}); + languageFeatureCliCanonicalSpelling_[EnumToInt(f)] = std::move(input); } void LanguageFeatureControl::ReplaceCliCanonicalSpelling( UsageWarning w, std::string input) { - std::string_view &old{usageWarningCliCanonicalSpelling_[EnumToInt(w)]}; - cliOptions_.erase(std::string{old}); - usageWarningCliCanonicalSpelling_[EnumToInt(w)] = input; + cliOptions_.erase(usageWarningCliCanonicalSpelling_[EnumToInt(w)]); cliOptions_.insert({input, {w}}); + usageWarningCliCanonicalSpelling_[EnumToInt(w)] = std::move(input); } std::vector LanguageFeatureControl::GetNames( diff --git a/flang/test/Evaluate/fold-dim.f90 b/flang/test/Evaluate/fold-dim.f90 index 40163c3f5a5ee..8e1b6ff0d1d8d 100644 --- a/flang/test/Evaluate/fold-dim.f90 +++ b/flang/test/Evaluate/fold-dim.f90 @@ -11,7 +11,7 @@ module m logical, parameter :: test_a3 = dim(2., 1.) == 1. logical, parameter :: test_a4 = dim(2., -1.) == 3. logical, parameter :: test_a5 = dim(-1., 2.) == 0. - !WARN: warning: invalid argument on division + !WARN: warning: invalid argument on division [-Wfolding-exception] real, parameter :: nan = 0./0. logical, parameter :: test_a6 = dim(nan, 1.) /= dim(nan, 1.) end module diff --git a/flang/test/Evaluate/fold-nearest.f90 b/flang/test/Evaluate/fold-nearest.f90 index 48b9ef37840e3..af5750462f6b0 100644 --- a/flang/test/Evaluate/fold-nearest.f90 +++ b/flang/test/Evaluate/fold-nearest.f90 @@ -19,16 +19,16 @@ module m1 real, parameter :: negZero = sign(0., -1.) logical, parameter :: test_12 = nearest(negZero, 1.) == minSubnormal logical, parameter :: test_13 = nearest(negZero, -1.) == -minSubnormal - !WARN: warning: NEAREST: S argument is zero + !WARN: warning: NEAREST: S argument is zero [-Wfolding-value-checks] logical, parameter :: test_14 = nearest(0., negZero) == -minSubnormal - !WARN: warning: NEAREST: S argument is zero + !WARN: warning: NEAREST: S argument is zero [-Wfolding-value-checks] logical, parameter :: test_15 = nearest(negZero, 0.) == minSubnormal logical, parameter :: test_16 = nearest(tiny(1.),-1.) == 1.1754942E-38 logical, parameter :: test_17 = nearest(tiny(1.),1.) == 1.1754945E-38 contains subroutine subr(a) real, intent(in) :: a - !WARN: warning: NEAREST: S argument is zero + !WARN: warning: NEAREST: S argument is zero [-Wfolding-value-checks] print *, nearest(a, 0.) end end module @@ -42,7 +42,7 @@ module m2 logical, parameter :: test_2 = ieee_next_after(minSubnormal, -1.) == 0 logical, parameter :: test_3 = ieee_next_after(1., 2.) == 1.0000001 logical, parameter :: test_4 = ieee_next_after(1.0000001, -1.) == 1 - !WARN: warning: division by zero + !WARN: warning: division by zero [-Wfolding-exception] real, parameter :: inf = 1. / 0. logical, parameter :: test_5 = ieee_next_after(inf, inf) == inf logical, parameter :: test_6 = ieee_next_after(inf, -inf) == h @@ -54,12 +54,12 @@ module m2 logical, parameter :: test_11 = ieee_next_after(1.9999999999999999999_10, 3.) == 2._10 #endif logical, parameter :: test_12 = ieee_next_after(1., 1.) == 1. - !WARN: warning: invalid argument on division + !WARN: warning: invalid argument on division [-Wfolding-exception] real, parameter :: nan = 0. / 0. - !WARN: warning: IEEE_NEXT_AFTER intrinsic folding: arguments are unordered + !WARN: warning: IEEE_NEXT_AFTER intrinsic folding: arguments are unordered [-Wfolding-value-checks] real, parameter :: x13 = ieee_next_after(nan, nan) logical, parameter :: test_13 = .not. (x13 == x13) - !WARN: warning: IEEE_NEXT_AFTER intrinsic folding: arguments are unordered + !WARN: warning: IEEE_NEXT_AFTER intrinsic folding: arguments are unordered [-Wfolding-value-checks] real, parameter :: x14 = ieee_next_after(nan, 0.) logical, parameter :: test_14 = .not. (x14 == x14) end module @@ -72,7 +72,7 @@ module m3 logical, parameter :: test_2 = ieee_next_down(0.d0) == -minSubnormal logical, parameter :: test_3 = ieee_next_up(1.d0) == 1.0000000000000002d0 logical, parameter :: test_4 = ieee_next_down(1.0000000000000002d0) == 1.d0 - !WARN: warning: division by zero + !WARN: warning: division by zero [-Wfolding-exception] real(kind(0.d0)), parameter :: inf = 1.d0 / 0.d0 logical, parameter :: test_5 = ieee_next_up(huge(0.d0)) == inf logical, parameter :: test_6 = ieee_next_down(-huge(0.d0)) == -inf @@ -82,12 +82,12 @@ module m3 logical, parameter :: test_10 = ieee_next_down(-inf) == -inf logical, parameter :: test_11 = ieee_next_up(1.9999999999999997d0) == 2.d0 logical, parameter :: test_12 = ieee_next_down(2.d0) == 1.9999999999999997d0 - !WARN: warning: invalid argument on division + !WARN: warning: invalid argument on division [-Wfolding-exception] real(kind(0.d0)), parameter :: nan = 0.d0 / 0.d0 - !WARN: warning: IEEE_NEXT_UP intrinsic folding: argument is NaN + !WARN: warning: IEEE_NEXT_UP intrinsic folding: argument is NaN [-Wfolding-exception] real(kind(0.d0)), parameter :: x13 = ieee_next_up(nan) logical, parameter :: test_13 = .not. (x13 == x13) - !WARN: warning: IEEE_NEXT_DOWN intrinsic folding: argument is NaN + !WARN: warning: IEEE_NEXT_DOWN intrinsic folding: argument is NaN [-Wfolding-exception] real(kind(0.d0)), parameter :: x14 = ieee_next_down(nan) logical, parameter :: test_14 = .not. (x14 == x14) end module diff --git a/flang/test/Evaluate/fold-out_of_range.f90 b/flang/test/Evaluate/fold-out_of_range.f90 index 6360eee5322bb..a2f453acb4cb2 100644 --- a/flang/test/Evaluate/fold-out_of_range.f90 +++ b/flang/test/Evaluate/fold-out_of_range.f90 @@ -9,23 +9,23 @@ module m integer(4), parameter :: i4v(*) = [ -huge(1_4) - 1_4, huge(1_4) ] integer(8), parameter :: i8v(*) = [ -huge(1_8) - 1_8, huge(1_8) ] integer(16), parameter :: i16v(*) = [ -huge(1_16) - 1_16, huge(1_16) ] - !WARN: warning: division by zero - !WARN: warning: invalid argument on division + !WARN: warning: division by zero [-Wfolding-exception] + !WARN: warning: invalid argument on division [-Wfolding-exception] real(2), parameter :: r2v(*) = [ -huge(1._2), huge(1._2), 1._2/0._2, 0._2/0._2 ] - !WARN: warning: division by zero - !WARN: warning: invalid argument on division + !WARN: warning: division by zero [-Wfolding-exception] + !WARN: warning: invalid argument on division [-Wfolding-exception] real(3), parameter :: r3v(*) = [ -huge(1._3), huge(1._3), 1._3/0._3, 0._3/0._3 ] - !WARN: warning: division by zero - !WARN: warning: invalid argument on division + !WARN: warning: division by zero [-Wfolding-exception] + !WARN: warning: invalid argument on division [-Wfolding-exception] real(4), parameter :: r4v(*) = [ -huge(1._4), huge(1._4), 1._4/0._4, 0._4/0._4 ] - !WARN: warning: division by zero - !WARN: warning: invalid argument on division + !WARN: warning: division by zero [-Wfolding-exception] + !WARN: warning: invalid argument on division [-Wfolding-exception] real(8), parameter :: r8v(*) = [ -huge(1._8), huge(1._8), 1._8/0._8, 0._8/0._8 ] - !WARN: warning: division by zero - !WARN: warning: invalid argument on division + !WARN: warning: division by zero [-Wfolding-exception] + !WARN: warning: invalid argument on division [-Wfolding-exception] real(10), parameter :: r10v(*) = [ -huge(1._10), huge(1._10), 1._10/0._10, 0._10/0._10 ] - !WARN: warning: division by zero - !WARN: warning: invalid argument on division + !WARN: warning: division by zero [-Wfolding-exception] + !WARN: warning: invalid argument on division [-Wfolding-exception] real(16), parameter :: r16v(*) = [ -huge(1._16), huge(1._16), 1._16/0._16, 0._16/0._16 ] logical, parameter :: finites(*) = [ .true., .true., .false., .false. ] @@ -93,7 +93,7 @@ module m logical, parameter :: test_r2r10 = .not. any(out_of_range(r2v, 1._10)) logical, parameter :: test_r2r16 = .not. any(out_of_range(r2v, 1._16)) logical, parameter :: test_r3r2 = all(out_of_range(r3v, 1._2) .eqv. finites) - !WARN: warning: invalid argument on REAL(2) to REAL(3) conversion + !WARN: warning: invalid argument on REAL(2) to REAL(3) conversion [-Wfolding-exception] logical, parameter :: test_r3r2b = .not. any(out_of_range(real(r2v, 3), 1._2)) logical, parameter :: test_r3r3 = .not. any(out_of_range(r3v, 1._3)) logical, parameter :: test_r3r4 = .not. any(out_of_range(r3v, 1._4)) @@ -101,55 +101,55 @@ module m logical, parameter :: test_r3r10 = .not. any(out_of_range(r3v, 1._10)) logical, parameter :: test_r3r16 = .not. any(out_of_range(r3v, 1._16)) logical, parameter :: test_r4r2 = all(out_of_range(r4v, 1._2) .eqv. finites) - !WARN: warning: invalid argument on REAL(2) to REAL(4) conversion + !WARN: warning: invalid argument on REAL(2) to REAL(4) conversion [-Wfolding-exception] logical, parameter :: test_r4r2b = .not. any(out_of_range(real(r2v, 4), 1._2)) logical, parameter :: test_r4r3 = all(out_of_range(r4v, 1._3) .eqv. finites) - !WARN: warning: invalid argument on REAL(3) to REAL(4) conversion + !WARN: warning: invalid argument on REAL(3) to REAL(4) conversion [-Wfolding-exception] logical, parameter :: test_r4r3b = .not. any(out_of_range(real(r3v, 4), 1._3)) logical, parameter :: test_r4r4 = .not. any(out_of_range(r4v, 1._4)) logical, parameter :: test_r4r8 = .not. any(out_of_range(r4v, 1._8)) logical, parameter :: test_r4r10 = .not. any(out_of_range(r4v, 1._10)) logical, parameter :: test_r4r16 = .not. any(out_of_range(r4v, 1._16)) logical, parameter :: test_r8r2 = all(out_of_range(r8v, 1._2) .eqv. finites) - !WARN: warning: invalid argument on REAL(2) to REAL(8) conversion + !WARN: warning: invalid argument on REAL(2) to REAL(8) conversion [-Wfolding-exception] logical, parameter :: test_r8r2b = .not. any(out_of_range(real(r2v, 8), 1._2)) logical, parameter :: test_r8r3 = all(out_of_range(r8v, 1._3) .eqv. finites) - !WARN: warning: invalid argument on REAL(3) to REAL(8) conversion + !WARN: warning: invalid argument on REAL(3) to REAL(8) conversion [-Wfolding-exception] logical, parameter :: test_r8r3b = .not. any(out_of_range(real(r3v, 8), 1._3)) logical, parameter :: test_r8r4 = all(out_of_range(r8v, 1._4) .eqv. finites) - !WARN: warning: invalid argument on REAL(4) to REAL(8) conversion + !WARN: warning: invalid argument on REAL(4) to REAL(8) conversion [-Wfolding-exception] logical, parameter :: test_r8r4b = .not. any(out_of_range(real(r4v, 8), 1._4)) logical, parameter :: test_r8r8 = .not. any(out_of_range(r8v, 1._8)) logical, parameter :: test_r8r10 = .not. any(out_of_range(r8v, 1._10)) logical, parameter :: test_r8r16 = .not. any(out_of_range(r8v, 1._16)) logical, parameter :: test_r10r2 = all(out_of_range(r10v, 1._2) .eqv. finites) - !WARN: warning: invalid argument on REAL(2) to REAL(10) conversion + !WARN: warning: invalid argument on REAL(2) to REAL(10) conversion [-Wfolding-exception] logical, parameter :: test_r10r2b = .not. any(out_of_range(real(r2v, 10), 1._2)) logical, parameter :: test_r10r3 = all(out_of_range(r10v, 1._3) .eqv. finites) - !WARN: warning: invalid argument on REAL(3) to REAL(10) conversion + !WARN: warning: invalid argument on REAL(3) to REAL(10) conversion [-Wfolding-exception] logical, parameter :: test_r10r3b = .not. any(out_of_range(real(r3v, 10), 1._3)) logical, parameter :: test_r10r4 = all(out_of_range(r10v, 1._4) .eqv. finites) - !WARN: warning: invalid argument on REAL(4) to REAL(10) conversion + !WARN: warning: invalid argument on REAL(4) to REAL(10) conversion [-Wfolding-exception] logical, parameter :: test_r10r4b = .not. any(out_of_range(real(r4v, 10), 1._4)) logical, parameter :: test_r10r8 = all(out_of_range(r10v, 1._8) .eqv. finites) - !WARN: warning: invalid argument on REAL(8) to REAL(10) conversion + !WARN: warning: invalid argument on REAL(8) to REAL(10) conversion [-Wfolding-exception] logical, parameter :: test_r10r8b = .not. any(out_of_range(real(r8v, 10), 1._8)) logical, parameter :: test_r10r10 = .not. any(out_of_range(r10v, 1._10)) logical, parameter :: test_r10r16 = .not. any(out_of_range(r10v, 1._16)) logical, parameter :: test_r16r2 = all(out_of_range(r16v, 1._2) .eqv. finites) - !WARN: warning: invalid argument on REAL(2) to REAL(16) conversion + !WARN: warning: invalid argument on REAL(2) to REAL(16) conversion [-Wfolding-exception] logical, parameter :: test_r16r2b = .not. any(out_of_range(real(r2v, 16), 1._2)) logical, parameter :: test_r16r3 = all(out_of_range(r16v, 1._3) .eqv. finites) - !WARN: warning: invalid argument on REAL(3) to REAL(16) conversion + !WARN: warning: invalid argument on REAL(3) to REAL(16) conversion [-Wfolding-exception] logical, parameter :: test_r16r3b = .not. any(out_of_range(real(r3v, 16), 1._3)) logical, parameter :: test_r16r4 = all(out_of_range(r16v, 1._4) .eqv. finites) - !WARN: warning: invalid argument on REAL(4) to REAL(16) conversion + !WARN: warning: invalid argument on REAL(4) to REAL(16) conversion [-Wfolding-exception] logical, parameter :: test_r16r4b = .not. any(out_of_range(real(r4v, 16), 1._4)) logical, parameter :: test_r16r8 = all(out_of_range(r16v, 1._8) .eqv. finites) - !WARN: warning: invalid argument on REAL(8) to REAL(16) conversion + !WARN: warning: invalid argument on REAL(8) to REAL(16) conversion [-Wfolding-exception] logical, parameter :: test_r16r8b = .not. any(out_of_range(real(r8v, 16), 1._8)) logical, parameter :: test_r16r10 = all(out_of_range(r16v, 1._10) .eqv. finites) - !WARN: warning: invalid argument on REAL(10) to REAL(16) conversion + !WARN: warning: invalid argument on REAL(10) to REAL(16) conversion [-Wfolding-exception] logical, parameter :: test_r16r10b= .not. any(out_of_range(real(r10v, 16), 1._10)) logical, parameter :: test_r16r16 = .not. any(out_of_range(r16v, 1._16)) @@ -223,29 +223,29 @@ module m logical, parameter :: test_r2i2ur = all(out_of_range(real(i2v, kind=2)+.5_2, 1_2, .true.) .eqv. [.false., .true.]) logical, parameter :: test_r2i2d = all(out_of_range(real(i2v, kind=2)-.5_2, 1_2, .false.) .eqv. [.false., .true.]) logical, parameter :: test_r2i2dr = all(out_of_range(real(i2v, kind=2)-.5_2, 1_2, .true.) .eqv. [.false., .true.]) - !WARN: warning: overflow on INTEGER(4) to REAL(2) conversion + !WARN: warning: overflow on INTEGER(4) to REAL(2) conversion [-Wfolding-exception] logical, parameter :: test_r2i4u = all(out_of_range(real(i4v, kind=2)+.5_2, 1_4, .false.) .eqv. [.true., .true.]) - !WARN: warning: overflow on INTEGER(4) to REAL(2) conversion + !WARN: warning: overflow on INTEGER(4) to REAL(2) conversion [-Wfolding-exception] logical, parameter :: test_r2i4ur = all(out_of_range(real(i4v, kind=2)+.5_2, 1_4, .true.) .eqv. [.true., .true.]) - !WARN: warning: overflow on INTEGER(4) to REAL(2) conversion + !WARN: warning: overflow on INTEGER(4) to REAL(2) conversion [-Wfolding-exception] logical, parameter :: test_r2i4d = all(out_of_range(real(i4v, kind=2)-.5_2, 1_4, .false.) .eqv. [.true., .true.]) - !WARN: warning: overflow on INTEGER(4) to REAL(2) conversion + !WARN: warning: overflow on INTEGER(4) to REAL(2) conversion [-Wfolding-exception] logical, parameter :: test_r2i4dr = all(out_of_range(real(i4v, kind=2)-.5_2, 1_4, .true.) .eqv. [.true., .true.]) - !WARN: warning: overflow on INTEGER(8) to REAL(2) conversion + !WARN: warning: overflow on INTEGER(8) to REAL(2) conversion [-Wfolding-exception] logical, parameter :: test_r2i8u = all(out_of_range(real(i8v, kind=2)+.5_2, 1_8, .false.) .eqv. [.true., .true.]) - !WARN: warning: overflow on INTEGER(8) to REAL(2) conversion + !WARN: warning: overflow on INTEGER(8) to REAL(2) conversion [-Wfolding-exception] logical, parameter :: test_r2i8ur = all(out_of_range(real(i8v, kind=2)+.5_2, 1_8, .true.) .eqv. [.true., .true.]) - !WARN: warning: overflow on INTEGER(8) to REAL(2) conversion + !WARN: warning: overflow on INTEGER(8) to REAL(2) conversion [-Wfolding-exception] logical, parameter :: test_r2i8d = all(out_of_range(real(i8v, kind=2)-.5_2, 1_8, .false.) .eqv. [.true., .true.]) - !WARN: warning: overflow on INTEGER(8) to REAL(2) conversion + !WARN: warning: overflow on INTEGER(8) to REAL(2) conversion [-Wfolding-exception] logical, parameter :: test_r2i8dr = all(out_of_range(real(i8v, kind=2)-.5_2, 1_8, .true.) .eqv. [.true., .true.]) - !WARN: warning: overflow on INTEGER(16) to REAL(2) conversion + !WARN: warning: overflow on INTEGER(16) to REAL(2) conversion [-Wfolding-exception] logical, parameter :: test_r2i16u = all(out_of_range(real(i16v, kind=2)+.5_2, 1_16, .false.) .eqv. [.true., .true.]) - !WARN: warning: overflow on INTEGER(16) to REAL(2) conversion + !WARN: warning: overflow on INTEGER(16) to REAL(2) conversion [-Wfolding-exception] logical, parameter :: test_r2i16ur = all(out_of_range(real(i16v, kind=2)+.5_2, 1_16, .true.) .eqv. [.true., .true.]) - !WARN: warning: overflow on INTEGER(16) to REAL(2) conversion + !WARN: warning: overflow on INTEGER(16) to REAL(2) conversion [-Wfolding-exception] logical, parameter :: test_r2i16d = all(out_of_range(real(i16v, kind=2)-.5_2, 1_16, .false.) .eqv. [.true., .true.]) - !WARN: warning: overflow on INTEGER(16) to REAL(2) conversion + !WARN: warning: overflow on INTEGER(16) to REAL(2) conversion [-Wfolding-exception] logical, parameter :: test_r2i16dr = all(out_of_range(real(i16v, kind=2)-.5_2, 1_16, .true.) .eqv. [.true., .true.]) logical, parameter :: test_r3i1u = all(out_of_range(real(i1v, kind=3)+.5_3, 1_1, .false.) .eqv. [.false., .false.]) @@ -357,7 +357,7 @@ module m subroutine s(x, r) real(8), intent(in) :: x logical, intent(in), optional :: r - !WARN: warning: ROUND= argument to OUT_OF_RANGE() is an optional dummy argument that must be present at execution + !WARN: warning: ROUND= argument to OUT_OF_RANGE() is an optional dummy argument that must be present at execution [-Woptional-must-be-present] print *, out_of_range(x, 1, round=r) end end diff --git a/flang/test/Evaluate/fold-unsigned.f90 b/flang/test/Evaluate/fold-unsigned.f90 index 719bdcc1a40b9..d53b7c7be0d5b 100644 --- a/flang/test/Evaluate/fold-unsigned.f90 +++ b/flang/test/Evaluate/fold-unsigned.f90 @@ -24,7 +24,7 @@ module m logical, parameter :: test_cus0 = int(0u,1) == 0 logical, parameter :: test_cus0_k = kind(int(0u,1)) == 1 - !WARN: warning: conversion of 255_U1 to INTEGER(1) overflowed; result is -1 + !WARN: warning: conversion of 255_U1 to INTEGER(1) overflowed; result is -1 [-Wfolding-exception] logical, parameter :: test_cus255 = int(255u_1,1) == -1 logical, parameter :: test_cur255 = real(255u) == 255. diff --git a/flang/test/Evaluate/folding03.f90 b/flang/test/Evaluate/folding03.f90 index 827bde86757c8..5b7ddd3c6c230 100644 --- a/flang/test/Evaluate/folding03.f90 +++ b/flang/test/Evaluate/folding03.f90 @@ -15,32 +15,32 @@ module integer_tests ! Integer division by zero are not tested here because they are handled as fatal ! errors in constants. - !WARN: warning: INTEGER(4) negation overflowed + !WARN: warning: INTEGER(4) negation overflowed [-Wfolding-exception] logical, parameter :: test_overflow_unary_minus1 = (-i4_nmax).EQ.i4_nmax logical, parameter :: test_no_overflow_unary_minus1 = (-i4_pmax).EQ.(i4_nmax+1_4) logical, parameter :: test_no_overflow_unary_plus1 = (+i4_pmax).EQ.i4_pmax logical, parameter :: test_no_overflow_unary_plus2 = (+i4_nmax).EQ.i4_nmax - !WARN: warning: INTEGER(4) addition overflowed + !WARN: warning: INTEGER(4) addition overflowed [-Wfolding-exception] logical, parameter :: test_overflow_add1 = (i4_pmax+1_4).EQ.i4_nmax - !WARN: warning: INTEGER(4) addition overflowed + !WARN: warning: INTEGER(4) addition overflowed [-Wfolding-exception] logical, parameter :: test_overflow_add2 = (i4_nmax + (-1_4)).EQ.i4_pmax - !WARN: warning: INTEGER(4) addition overflowed + !WARN: warning: INTEGER(4) addition overflowed [-Wfolding-exception] logical, parameter :: test_overflow_add3 = (i4_pmax + i4_pmax).EQ.(-2_4) - !WARN: warning: INTEGER(4) addition overflowed + !WARN: warning: INTEGER(4) addition overflowed [-Wfolding-exception] logical, parameter :: test_overflow_add4 = (i4_nmax + i4_nmax).EQ.(0_4) logical, parameter :: test_no_overflow_add1 = (i4_pmax + 0_4).EQ.i4_pmax logical, parameter :: test_no_overflow_add2 = (i4_nmax + (-0_4)).EQ.i4_nmax logical, parameter :: test_no_overflow_add3 = (i4_pmax + i4_nmax).EQ.(-1_4) logical, parameter :: test_no_overflow_add4 = (i4_nmax + i4_pmax).EQ.(-1_4) - !WARN: warning: INTEGER(4) subtraction overflowed + !WARN: warning: INTEGER(4) subtraction overflowed [-Wfolding-exception] logical, parameter :: test_overflow_sub1 = (i4_nmax - 1_4).EQ.i4_pmax - !WARN: warning: INTEGER(4) subtraction overflowed + !WARN: warning: INTEGER(4) subtraction overflowed [-Wfolding-exception] logical, parameter :: test_overflow_sub2 = (i4_pmax - (-1_4)).EQ.i4_nmax - !WARN: warning: INTEGER(4) subtraction overflowed + !WARN: warning: INTEGER(4) subtraction overflowed [-Wfolding-exception] logical, parameter :: test_overflow_sub3 = (i4_nmax - i4_pmax).EQ.(1_4) - !WARN: warning: INTEGER(4) subtraction overflowed + !WARN: warning: INTEGER(4) subtraction overflowed [-Wfolding-exception] logical, parameter :: test_overflow_sub4 = (i4_pmax - i4_nmax).EQ.(-1_4) logical, parameter :: test_no_overflow_sub1 = (i4_nmax - 0_4).EQ.i4_nmax logical, parameter :: test_no_overflow_sub2 = (i4_pmax - (-0_4)).EQ.i4_pmax @@ -48,23 +48,23 @@ module integer_tests logical, parameter :: test_no_overflow_sub4 = (i4_pmax - i4_pmax).EQ.0_4 - !WARN: warning: INTEGER(4) multiplication overflowed + !WARN: warning: INTEGER(4) multiplication overflowed [-Wfolding-exception] logical, parameter :: test_overflow_mult1 = (i4_pmax*2_4).EQ.(-2_4) - !WARN: warning: INTEGER(4) multiplication overflowed + !WARN: warning: INTEGER(4) multiplication overflowed [-Wfolding-exception] logical, parameter :: test_overflow_mult2 = (i4_nmax*2_4).EQ.(0_4) - !WARN: warning: INTEGER(4) multiplication overflowed + !WARN: warning: INTEGER(4) multiplication overflowed [-Wfolding-exception] logical, parameter :: test_overflow_mult3 = (i4_nmax*i4_nmax).EQ.(0_4) - !WARN: warning: INTEGER(4) multiplication overflowed + !WARN: warning: INTEGER(4) multiplication overflowed [-Wfolding-exception] logical, parameter :: test_overflow_mult4 = (i4_pmax*i4_pmax).EQ.(1_4) - !WARN: warning: INTEGER(4) division overflowed + !WARN: warning: INTEGER(4) division overflowed [-Wfolding-exception] logical, parameter :: test_overflow_div1 = (i4_nmax/(-1_4)).EQ.(i4_nmax) logical, parameter :: test_no_overflow_div1 = (i4_nmax/(-2_4)).EQ.(1_4 + i4_pmax/2_4) logical, parameter :: test_no_overflow_div2 = (i4_nmax/i4_nmax).EQ.(1_4) - !WARN: warning: INTEGER(4) power overflowed + !WARN: warning: INTEGER(4) power overflowed [-Wfolding-exception] logical, parameter :: test_overflow_pow1 = (i4_pmax**2_4).EQ.(1_4) - !WARN: warning: INTEGER(4) power overflowed + !WARN: warning: INTEGER(4) power overflowed [-Wfolding-exception] logical, parameter :: test_overflow_pow3 = (i4_nmax**2_4).EQ.(0_4) logical, parameter :: test_no_overflow_pow1 = ((-1_4)**i4_nmax).EQ.(1_4) logical, parameter :: test_no_overflow_pow2 = ((-1_4)**i4_pmax).EQ.(-1_4) @@ -76,12 +76,12 @@ module real_tests real(4), parameter :: r4_pmax = 3.4028235E38 real(4), parameter :: r4_nmax = -3.4028235E38 - !WARN: warning: invalid argument on division + !WARN: warning: invalid argument on division [-Wfolding-exception] real(4), parameter :: r4_nan = 0._4/0._4 TEST_ISNAN(r4_nan) - !WARN: warning: division by zero + !WARN: warning: division by zero [-Wfolding-exception] real(4), parameter :: r4_pinf = 1._4/0._4 - !WARN: warning: division by zero + !WARN: warning: division by zero [-Wfolding-exception] real(4), parameter :: r4_ninf = -1._4/0._4 logical, parameter :: test_r4_nan_parentheses1 = .NOT.(((r4_nan)).EQ.r4_nan) @@ -106,13 +106,13 @@ module real_tests real(4), parameter :: r4_nan_plus = (+r4_nan) TEST_ISNAN(r4_nan_plus) - !WARN: warning: overflow on addition + !WARN: warning: overflow on addition [-Wfolding-exception] logical, parameter :: test_inf_r4_add9 = (r4_pmax + r4_pmax).eq.(r4_pinf) - !WARN: warning: overflow on addition + !WARN: warning: overflow on addition [-Wfolding-exception] logical, parameter :: test_inf_r4_add10 = (r4_nmax + r4_nmax).eq.(r4_ninf) - !WARN: warning: overflow on subtraction + !WARN: warning: overflow on subtraction [-Wfolding-exception] logical, parameter :: test_inf_r4_sub9 = (r4_pmax - r4_nmax).eq.(r4_pinf) - !WARN: warning: overflow on subtraction + !WARN: warning: overflow on subtraction [-Wfolding-exception] logical, parameter :: test_inf_r4_sub10 = (r4_nmax - r4_pmax).eq.(r4_ninf) ! No warnings expected below (inf propagation). @@ -125,16 +125,16 @@ module real_tests logical, parameter :: test_inf_r4_add7 = (r4_ninf + 0._4).EQ.(r4_ninf) logical, parameter :: test_inf_r4_add8 = (r4_pinf + 0._4).EQ.(r4_pinf) - !WARN: warning: invalid argument on subtraction + !WARN: warning: invalid argument on subtraction [-Wfolding-exception] real(4), parameter :: r4_nan_sub1 = r4_pinf - r4_pinf TEST_ISNAN(r4_nan_sub1) - !WARN: warning: invalid argument on subtraction + !WARN: warning: invalid argument on subtraction [-Wfolding-exception] real(4), parameter :: r4_nan_sub2 = r4_ninf - r4_ninf TEST_ISNAN(r4_nan_sub2) - !WARN: warning: invalid argument on addition + !WARN: warning: invalid argument on addition [-Wfolding-exception] real(4), parameter :: r4_nan_add1 = r4_ninf + r4_pinf TEST_ISNAN(r4_nan_add1) - !WARN: warning: invalid argument on addition + !WARN: warning: invalid argument on addition [-Wfolding-exception] real(4), parameter :: r4_nan_add2 = r4_pinf + r4_ninf TEST_ISNAN(r4_nan_add2) @@ -156,13 +156,13 @@ module real_tests real(4), parameter :: r4_nan_add6 = r4_nan + r4_nan TEST_ISNAN(r4_nan_add6) - !WARN: warning: overflow on multiplication + !WARN: warning: overflow on multiplication [-Wfolding-exception] logical, parameter :: test_inf_r4_mult1 = (1.5_4*r4_pmax).eq.(r4_pinf) - !WARN: warning: overflow on multiplication + !WARN: warning: overflow on multiplication [-Wfolding-exception] logical, parameter :: test_inf_r4_mult2 = (1.5_4*r4_nmax).eq.(r4_ninf) - !WARN: warning: overflow on division + !WARN: warning: overflow on division [-Wfolding-exception] logical, parameter :: test_inf_r4_div1 = (r4_nmax/(-0.5_4)).eq.(r4_pinf) - !WARN: warning: overflow on division + !WARN: warning: overflow on division [-Wfolding-exception] logical, parameter :: test_inf_r4_div2 = (r4_pmax/(-0.5_4)).eq.(r4_ninf) ! No warnings expected below (inf propagation). @@ -179,25 +179,25 @@ module real_tests logical, parameter :: test_inf_r4_div9 = (r4_nmax/r4_pinf).EQ.(0.) logical, parameter :: test_inf_r4_div10 = (r4_nmax/r4_ninf).EQ.(0.) - !WARN: warning: invalid argument on division + !WARN: warning: invalid argument on division [-Wfolding-exception] real(4), parameter :: r4_nan_div1 = 0._4/0._4 TEST_ISNAN(r4_nan_div1) - !WARN: warning: invalid argument on division + !WARN: warning: invalid argument on division [-Wfolding-exception] real(4), parameter :: r4_nan_div2 = r4_ninf/r4_ninf TEST_ISNAN(r4_nan_div2) - !WARN: warning: invalid argument on division + !WARN: warning: invalid argument on division [-Wfolding-exception] real(4), parameter :: r4_nan_div3 = r4_ninf/r4_pinf TEST_ISNAN(r4_nan_div3) - !WARN: warning: invalid argument on division + !WARN: warning: invalid argument on division [-Wfolding-exception] real(4), parameter :: r4_nan_div4 = r4_pinf/r4_ninf TEST_ISNAN(r4_nan_div4) - !WARN: warning: invalid argument on division + !WARN: warning: invalid argument on division [-Wfolding-exception] real(4), parameter :: r4_nan_div5 = r4_pinf/r4_pinf TEST_ISNAN(r4_nan_div5) - !WARN: warning: invalid argument on multiplication + !WARN: warning: invalid argument on multiplication [-Wfolding-exception] real(4), parameter :: r4_nan_mult1 = r4_pinf*0._4 TEST_ISNAN(r4_nan_mult1) - !WARN: warning: invalid argument on multiplication + !WARN: warning: invalid argument on multiplication [-Wfolding-exception] real(4), parameter :: r4_nan_mult2 = 0._4*r4_ninf TEST_ISNAN(r4_nan_mult2) diff --git a/flang/test/Evaluate/folding04.f90 b/flang/test/Evaluate/folding04.f90 index 08c5c6eee9b12..027db20f608b2 100644 --- a/flang/test/Evaluate/folding04.f90 +++ b/flang/test/Evaluate/folding04.f90 @@ -10,11 +10,11 @@ module real_tests real(4), parameter :: r4_pmax = 3.4028235E38 real(4), parameter :: r4_nmax = -3.4028235E38 - !WARN: warning: invalid argument on division + !WARN: warning: invalid argument on division [-Wfolding-exception] real(4), parameter :: r4_nan = 0._4/0._4 - !WARN: warning: division by zero + !WARN: warning: division by zero [-Wfolding-exception] real(4), parameter :: r4_pinf = 1._4/0._4 - !WARN: warning: division by zero + !WARN: warning: division by zero [-Wfolding-exception] real(4), parameter :: r4_ninf = -1._4/0._4 !WARN: warning: argument is out of range [-1., 1.] @@ -37,7 +37,7 @@ module real_tests TEST_ISNAN(nan_r8_dasin1) !WARN: warning: complex argument must be different from zero complex(4), parameter :: c4_clog1 = clog((0., 0.)) - !WARN: warning: MOD: P argument is zero + !WARN: warning: MOD: P argument is zero [-Wfolding-avoids-runtime-crash] real(4), parameter :: nan_r4_mod = mod(3.5, 0.) TEST_ISNAN(nan_r4_mod) real(4), parameter :: ok_r4_gamma = gamma(-1.1) @@ -53,17 +53,17 @@ module real_tests !WARN: warning: 'x' and 'y' arguments must not be both zero real(4), parameter :: r4_atan2 = atan2(0., 0.) - !WARN: warning: overflow on evaluation of intrinsic function or operation + !WARN: warning: overflow on evaluation of intrinsic function or operation [-Wfolding-exception] logical, parameter :: test_exp_overflow = exp(256._4).EQ.r4_pinf contains subroutine s1(a,j) - !WARN: warning: MOD: P argument is zero + !WARN: warning: MOD: P argument is zero [-Wfolding-avoids-runtime-crash] print *, mod(a, 0.) - !WARN: warning: MODULO: P argument is zero + !WARN: warning: MODULO: P argument is zero [-Wfolding-avoids-runtime-crash] print *, modulo(a, 0.) - !WARN: warning: MOD: P argument is zero + !WARN: warning: MOD: P argument is zero [-Wfolding-avoids-runtime-crash] print *, mod(j, 0.) - !WARN: warning: MODULO: P argument is zero + !WARN: warning: MODULO: P argument is zero [-Wfolding-avoids-runtime-crash] print *, modulo(j, 0.) end end module @@ -86,13 +86,13 @@ module specific_extremums ! specified for f18 (converting the result). integer(8), parameter :: max_i32_8 = 2_8**31-1 integer, parameter :: expected_min0 = int(min(max_i32_8, 2_8*max_i32_8), 4) - !WARN: portability: Argument types do not match specific intrinsic 'min0' requirements; using 'min' generic instead and converting the result to INTEGER(4) if needed + !WARN: portability: Argument types do not match specific intrinsic 'min0' requirements; using 'min' generic instead and converting the result to INTEGER(4) if needed [-Wuse-generic-intrinsic-when-specific-doesnt-match] integer, parameter :: result_min0 = min0(max_i32_8, 2_8*max_i32_8) ! result_min0 would be -2 if arguments were converted to default integer. logical, parameter :: test_min0 = expected_min0 .EQ. result_min0 real, parameter :: expected_amax0 = real(max(max_i32_8, 2_8*max_i32_8), 4) - !WARN: portability: Argument types do not match specific intrinsic 'amax0' requirements; using 'max' generic instead and converting the result to REAL(4) if needed + !WARN: portability: Argument types do not match specific intrinsic 'amax0' requirements; using 'max' generic instead and converting the result to REAL(4) if needed [-Wuse-generic-intrinsic-when-specific-doesnt-match] real, parameter :: result_amax0 = amax0(max_i32_8, 2_8*max_i32_8) ! result_amax0 would be 2.1474836E+09 if arguments were converted to default integer first. logical, parameter :: test_amax0 = expected_amax0 .EQ. result_amax0 diff --git a/flang/test/Evaluate/folding05.f90 b/flang/test/Evaluate/folding05.f90 index eb762775e6416..aed1906e6a640 100644 Binary files a/flang/test/Evaluate/folding05.f90 and b/flang/test/Evaluate/folding05.f90 differ diff --git a/flang/test/Evaluate/folding06.f90 b/flang/test/Evaluate/folding06.f90 index da434fb6d4869..d4f11b0c30f1f 100644 --- a/flang/test/Evaluate/folding06.f90 +++ b/flang/test/Evaluate/folding06.f90 @@ -7,12 +7,12 @@ module m integer, pointer :: int_pointer integer, allocatable :: int_allocatable logical, parameter :: test_Assoc1 = .not.(associated(null())) - !WARN: portability: POINTER= argument of ASSOCIATED() is required by some other compilers to be a valid left-hand side of a pointer assignment statement + !WARN: portability: POINTER= argument of ASSOCIATED() is required by some other compilers to be a valid left-hand side of a pointer assignment statement [-Wportability] !WARN: because: 'NULL()' is a null pointer logical, parameter :: test_Assoc2 = .not.(associated(null(), null())) logical, parameter :: test_Assoc3 = .not.(associated(null(int_pointer))) logical, parameter :: test_Alloc1 = .not.(allocated(null(int_allocatable))) - !WARN: portability: POINTER= argument of ASSOCIATED() is required by some other compilers to be a valid left-hand side of a pointer assignment statement + !WARN: portability: POINTER= argument of ASSOCIATED() is required by some other compilers to be a valid left-hand side of a pointer assignment statement [-Wportability] !WARN: because: 'NULL()' is a null pointer logical, parameter :: test_Assoc5 = .not. associated(null(), null(int_pointer)) diff --git a/flang/test/Evaluate/folding14.f90 b/flang/test/Evaluate/folding14.f90 index 2cf1c32f6cb3f..4ff9e107d1610 100644 --- a/flang/test/Evaluate/folding14.f90 +++ b/flang/test/Evaluate/folding14.f90 @@ -4,9 +4,9 @@ module m1 logical, parameter :: results(*) = isnan([ & 0., & -0., & -!WARN: warning: division by zero +!WARN: warning: division by zero [-Wfolding-exception] 1./0., & -!WARN: warning: invalid argument on division +!WARN: warning: invalid argument on division [-Wfolding-exception] 0./0., & real(z'7ff80001',kind=4), & real(z'fff80001',kind=4), & diff --git a/flang/test/Evaluate/folding28.f90 b/flang/test/Evaluate/folding28.f90 index 642919de7414a..3a795540812ab 100644 --- a/flang/test/Evaluate/folding28.f90 +++ b/flang/test/Evaluate/folding28.f90 @@ -15,7 +15,7 @@ module m ! -0 (sqrt is -0) real(8), parameter :: n08 = z'8000000000000000' real(8), parameter :: sqrt_n08 = sqrt(n08) - !WARN: warning: division by zero + !WARN: warning: division by zero [-Wfolding-exception] real(8), parameter :: inf_n08 = 1.0_8 / sqrt_n08, inf_n08z = z'fff0000000000000' logical, parameter :: test_n08 = inf_n08 == inf_n08z ! min normal diff --git a/flang/test/Semantics/OpenACC/acc-branch.f90 b/flang/test/Semantics/OpenACC/acc-branch.f90 index b3692d0165890..a2d7b583f6794 100644 --- a/flang/test/Semantics/OpenACC/acc-branch.f90 +++ b/flang/test/Semantics/OpenACC/acc-branch.f90 @@ -74,7 +74,7 @@ subroutine openacc_clause_validity ! Exit branches out of parallel construct, attached to an OpenACC parallel construct. thisblk: BLOCK fortname: if (.true.) then - !PORTABILITY: The construct name 'name1' should be distinct at the subprogram level + !PORTABILITY: The construct name 'name1' should be distinct at the subprogram level [-Wbenign-name-clash] name1: do k = 1, N !$acc parallel !ERROR: EXIT to construct 'fortname' outside of PARALLEL construct is not allowed diff --git a/flang/test/Semantics/OpenACC/acc-data.f90 b/flang/test/Semantics/OpenACC/acc-data.f90 index 473b91d555cea..98582f8174896 100644 --- a/flang/test/Semantics/OpenACC/acc-data.f90 +++ b/flang/test/Semantics/OpenACC/acc-data.f90 @@ -132,7 +132,7 @@ program openacc_data_validity !ERROR: At least one of COPYOUT, DELETE, DETACH clause must appear on the EXIT DATA directive !$acc exit data - !PORTABILITY: At least one of ATTACH, COPY, COPYIN, COPYOUT, CREATE, DEFAULT, DEVICEPTR, NO_CREATE, PRESENT clause should appear on the DATA directive + !PORTABILITY: At least one of ATTACH, COPY, COPYIN, COPYOUT, CREATE, DEFAULT, DEVICEPTR, NO_CREATE, PRESENT clause should appear on the DATA directive [-Wportability] !$acc data !$acc end data diff --git a/flang/test/Semantics/OpenACC/acc-declare-validity.f90 b/flang/test/Semantics/OpenACC/acc-declare-validity.f90 index 7cdc69436704b..5ee61fac0660a 100644 --- a/flang/test/Semantics/OpenACC/acc-declare-validity.f90 +++ b/flang/test/Semantics/OpenACC/acc-declare-validity.f90 @@ -14,7 +14,7 @@ module openacc_declare_validity !$acc declare create(aa, bb) - !WARNING: 'aa' in the CREATE clause is already present in the same clause in this module + !WARNING: 'aa' in the CREATE clause is already present in the same clause in this module [-Wopen-acc-usage] !$acc declare create(aa) !$acc declare link(ab) diff --git a/flang/test/Semantics/OpenACC/acc-serial.f90 b/flang/test/Semantics/OpenACC/acc-serial.f90 index 1f22003ed6b11..f3b81c992e6ea 100644 --- a/flang/test/Semantics/OpenACC/acc-serial.f90 +++ b/flang/test/Semantics/OpenACC/acc-serial.f90 @@ -84,15 +84,15 @@ program openacc_serial_validity !$acc serial wait(wait1) wait(wait2) !$acc end serial - !PORTABILITY: NUM_GANGS clause is not allowed on the SERIAL directive and will be ignored + !PORTABILITY: NUM_GANGS clause is not allowed on the SERIAL directive and will be ignored [-Wportability] !$acc serial num_gangs(8) !$acc end serial - !PORTABILITY: NUM_WORKERS clause is not allowed on the SERIAL directive and will be ignored + !PORTABILITY: NUM_WORKERS clause is not allowed on the SERIAL directive and will be ignored [-Wportability] !$acc serial num_workers(8) !$acc end serial - !PORTABILITY: VECTOR_LENGTH clause is not allowed on the SERIAL directive and will be ignored + !PORTABILITY: VECTOR_LENGTH clause is not allowed on the SERIAL directive and will be ignored [-Wportability] !$acc serial vector_length(128) !$acc end serial diff --git a/flang/test/Semantics/OpenMP/allocate-align01.f90 b/flang/test/Semantics/OpenMP/allocate-align01.f90 index bc17d7047bbb5..508efa82f12a0 100644 --- a/flang/test/Semantics/OpenMP/allocate-align01.f90 +++ b/flang/test/Semantics/OpenMP/allocate-align01.f90 @@ -13,7 +13,7 @@ program allocate_align_tree z = 3 !ERROR: The alignment value should be a constant positive integer !$omp allocate(j) align(xx) - !WARNING: OpenMP directive ALLOCATE has been deprecated, please use ALLOCATORS instead. + !WARNING: OpenMP directive ALLOCATE has been deprecated, please use ALLOCATORS instead. [-Wopen-mp-usage] !ERROR: The alignment value should be a constant positive integer !$omp allocate(xarray) align(-32) allocator(omp_large_cap_mem_alloc) allocate(j(z), xarray(t)) diff --git a/flang/test/Semantics/OpenMP/allocate01.f90 b/flang/test/Semantics/OpenMP/allocate01.f90 index b205b2c79d65b..e0b084ff0030b 100644 --- a/flang/test/Semantics/OpenMP/allocate01.f90 +++ b/flang/test/Semantics/OpenMP/allocate01.f90 @@ -19,7 +19,7 @@ subroutine sema() !$omp allocate(y) print *, a - !WARNING: OpenMP directive ALLOCATE has been deprecated, please use ALLOCATORS instead. + !WARNING: OpenMP directive ALLOCATE has been deprecated, please use ALLOCATORS instead. [-Wopen-mp-usage] !ERROR: List items must be declared in the same scoping unit in which the ALLOCATE directive appears !$omp allocate(x) allocator(omp_default_mem_alloc) allocate ( x(a), darray(a, b) ) diff --git a/flang/test/Semantics/OpenMP/clause-validity01.f90 b/flang/test/Semantics/OpenMP/clause-validity01.f90 index 6989a183e83ed..bc1371847b792 100644 --- a/flang/test/Semantics/OpenMP/clause-validity01.f90 +++ b/flang/test/Semantics/OpenMP/clause-validity01.f90 @@ -483,14 +483,14 @@ ! 2.13.1 master !$omp parallel - !WARNING: OpenMP directive MASTER has been deprecated, please use MASKED instead. + !WARNING: OpenMP directive MASTER has been deprecated, please use MASKED instead. [-Wopen-mp-usage] !$omp master a=3.14 !$omp end master !$omp end parallel !$omp parallel - !WARNING: OpenMP directive MASTER has been deprecated, please use MASKED instead. + !WARNING: OpenMP directive MASTER has been deprecated, please use MASKED instead. [-Wopen-mp-usage] !ERROR: NUM_THREADS clause is not allowed on the MASTER directive !$omp master num_threads(4) a=3.14 diff --git a/flang/test/Semantics/OpenMP/copying.f90 b/flang/test/Semantics/OpenMP/copying.f90 index 63fb39a0f26e5..d79027361f2ab 100644 --- a/flang/test/Semantics/OpenMP/copying.f90 +++ b/flang/test/Semantics/OpenMP/copying.f90 @@ -10,7 +10,7 @@ subroutine firstprivate() class(*), allocatable, save :: x - !PORTABILITY: If a polymorphic variable with allocatable attribute 'x' is in FIRSTPRIVATE clause, the behavior is unspecified + !PORTABILITY: If a polymorphic variable with allocatable attribute 'x' is in FIRSTPRIVATE clause, the behavior is unspecified [-Wportability] !$omp parallel firstprivate(x) call sub() !$omp end parallel @@ -20,7 +20,7 @@ subroutine firstprivate() subroutine lastprivate() class(*), allocatable, save :: x - !PORTABILITY: If a polymorphic variable with allocatable attribute 'x' is in LASTPRIVATE clause, the behavior is unspecified + !PORTABILITY: If a polymorphic variable with allocatable attribute 'x' is in LASTPRIVATE clause, the behavior is unspecified [-Wportability] !$omp do lastprivate(x) do i = 1, 10 call sub() @@ -33,7 +33,7 @@ subroutine copyin() class(*), allocatable, save :: x !$omp threadprivate(x) - !PORTABILITY: If a polymorphic variable with allocatable attribute 'x' is in COPYIN clause, the behavior is unspecified + !PORTABILITY: If a polymorphic variable with allocatable attribute 'x' is in COPYIN clause, the behavior is unspecified [-Wportability] !$omp parallel copyin(x) call sub() !$omp end parallel @@ -46,7 +46,7 @@ subroutine copyprivate() !$omp single call sub() - !PORTABILITY: If a polymorphic variable with allocatable attribute 'x' is in COPYPRIVATE clause, the behavior is unspecified + !PORTABILITY: If a polymorphic variable with allocatable attribute 'x' is in COPYPRIVATE clause, the behavior is unspecified [-Wportability] !$omp end single copyprivate(x) end diff --git a/flang/test/Semantics/OpenMP/declarative-directive01.f90 b/flang/test/Semantics/OpenMP/declarative-directive01.f90 index e8bf605565fad..9e6e6021ffab2 100644 --- a/flang/test/Semantics/OpenMP/declarative-directive01.f90 +++ b/flang/test/Semantics/OpenMP/declarative-directive01.f90 @@ -56,10 +56,10 @@ module m2 contains subroutine foo !$omp declare target - !WARNING: The entity with PARAMETER attribute is used in a DECLARE TARGET directive - !WARNING: The entity with PARAMETER attribute is used in a DECLARE TARGET directive + !WARNING: The entity with PARAMETER attribute is used in a DECLARE TARGET directive [-Wopen-mp-usage] + !WARNING: The entity with PARAMETER attribute is used in a DECLARE TARGET directive [-Wopen-mp-usage] !$omp declare target (foo, N, M) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly @@ -68,7 +68,7 @@ subroutine foo !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly !$omp declare target enter(Q, S) link(R) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly !ERROR: MAP clause is not allowed on the DECLARE TARGET directive !$omp declare target to(Q) map(from:Q) diff --git a/flang/test/Semantics/OpenMP/declare-target01.f90 b/flang/test/Semantics/OpenMP/declare-target01.f90 index 0651d3b5d89c1..39185b171b6b4 100644 --- a/flang/test/Semantics/OpenMP/declare-target01.f90 +++ b/flang/test/Semantics/OpenMP/declare-target01.f90 @@ -51,84 +51,84 @@ module declare_target01 !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive !$omp declare target (y%KIND) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (my_var) !$omp declare target enter (my_var) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (my_var) device_type(host) !$omp declare target enter (my_var) device_type(host) !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (my_var%t_i) !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive !$omp declare target enter (my_var%t_i) !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (my_var%t_arr) !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive !$omp declare target enter (my_var%t_arr) !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (my_var%kind_param) !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive !$omp declare target enter (my_var%kind_param) !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (my_var%len_param) !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive !$omp declare target enter (my_var%len_param) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (arr) !$omp declare target enter (arr) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (arr) device_type(nohost) !$omp declare target enter (arr) device_type(nohost) !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (arr(1)) !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive !$omp declare target enter (arr(1)) !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (arr(1:2)) !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the DECLARE TARGET directive !$omp declare target enter (arr(1:2)) !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (x%KIND) !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive !$omp declare target enter (x%KIND) !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (w%LEN) !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive !$omp declare target enter (w%LEN) !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (y%KIND) !ERROR: A type parameter inquiry cannot appear on the DECLARE TARGET directive diff --git a/flang/test/Semantics/OpenMP/declare-target02.f90 b/flang/test/Semantics/OpenMP/declare-target02.f90 index 0f12180587f83..5146ed8c89f08 100644 --- a/flang/test/Semantics/OpenMP/declare-target02.f90 +++ b/flang/test/Semantics/OpenMP/declare-target02.f90 @@ -16,17 +16,17 @@ program declare_target02 !ERROR: A variable in a DECLARE TARGET directive cannot be an element of a common block !$omp declare target (a1) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (arr1_to) !$omp declare target enter (arr1_to) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (blk1_to) !$omp declare target enter (blk1_to) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: A variable in a DECLARE TARGET directive cannot be an element of a common block !$omp declare target to (a1_to) @@ -44,7 +44,7 @@ program declare_target02 !ERROR: A variable in a DECLARE TARGET directive cannot appear in an EQUIVALENCE statement !$omp declare target (eq_a) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: A variable in a DECLARE TARGET directive cannot appear in an EQUIVALENCE statement !$omp declare target to (eq_a) @@ -57,7 +57,7 @@ program declare_target02 !ERROR: A variable in a DECLARE TARGET directive cannot appear in an EQUIVALENCE statement !$omp declare target (eq_c) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: A variable in a DECLARE TARGET directive cannot appear in an EQUIVALENCE statement !$omp declare target to (eq_c) @@ -87,26 +87,26 @@ subroutine func() !ERROR: A variable in a DECLARE TARGET directive cannot be an element of a common block !$omp declare target (a3) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly !$omp declare target to (arr2_to) !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly !$omp declare target enter (arr2_to) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (arr3_to) !$omp declare target enter (arr3_to) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: A variable in a DECLARE TARGET directive cannot be an element of a common block !$omp declare target to (a2_to) !ERROR: A variable in a DECLARE TARGET directive cannot be an element of a common block !$omp declare target enter (a2_to) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: A variable in a DECLARE TARGET directive cannot be an element of a common block !$omp declare target to (a3_to) @@ -137,16 +137,16 @@ module mod4 !ERROR: A variable in a DECLARE TARGET directive cannot be an element of a common block !$omp declare target (a4) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (arr4_to) !$omp declare target enter (arr4_to) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to (blk4_to) !$omp declare target enter (blk4_to) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: A variable in a DECLARE TARGET directive cannot be an element of a common block !$omp declare target to (a4_to) @@ -174,21 +174,21 @@ subroutine func5() !ERROR: A variable in a DECLARE TARGET directive cannot be an element of a common block !$omp declare target (a5) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly !$omp declare target to (arr5_to) !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly !$omp declare target enter (arr5_to) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly !$omp declare target to (blk5_to) !ERROR: A variable that appears in a DECLARE TARGET directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly !$omp declare target enter (blk5_to) - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: A variable in a DECLARE TARGET directive cannot be an element of a common block !$omp declare target to (a5_to) diff --git a/flang/test/Semantics/OpenMP/declare-target03.f90 b/flang/test/Semantics/OpenMP/declare-target03.f90 index bb1ed90e390f3..64a299d78224a 100644 --- a/flang/test/Semantics/OpenMP/declare-target03.f90 +++ b/flang/test/Semantics/OpenMP/declare-target03.f90 @@ -16,7 +16,7 @@ program main !ERROR: The module name or main program name cannot be in a DECLARE TARGET directive !$omp declare target (mod1) - !PORTABILITY: Name 'main' declared in a main program should not have the same name as the main program + !PORTABILITY: Name 'main' declared in a main program should not have the same name as the main program [-Wbenign-name-clash] !ERROR: The module name or main program name cannot be in a DECLARE TARGET directive !$omp declare target (main) end diff --git a/flang/test/Semantics/OpenMP/declare-target06.f90 b/flang/test/Semantics/OpenMP/declare-target06.f90 index 7df0a73123094..08fe531af6953 100644 --- a/flang/test/Semantics/OpenMP/declare-target06.f90 +++ b/flang/test/Semantics/OpenMP/declare-target06.f90 @@ -12,7 +12,7 @@ module test_0 !ERROR: No explicit type declared for 'no_implicit_materialization_2' !$omp declare target link(no_implicit_materialization_2) -!WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. +!WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !ERROR: No explicit type declared for 'no_implicit_materialization_3' !$omp declare target to(no_implicit_materialization_3) diff --git a/flang/test/Semantics/OpenMP/deprecation.f90 b/flang/test/Semantics/OpenMP/deprecation.f90 index df15c3bcc0b13..bc1c96d595e71 100644 --- a/flang/test/Semantics/OpenMP/deprecation.f90 +++ b/flang/test/Semantics/OpenMP/deprecation.f90 @@ -4,7 +4,7 @@ subroutine test_master() integer :: c = 1 -!WARNING: OpenMP directive MASTER has been deprecated, please use MASKED instead. +!WARNING: OpenMP directive MASTER has been deprecated, please use MASKED instead. [-Wopen-mp-usage] !$omp master c = c + 1 !$omp end master @@ -12,7 +12,7 @@ subroutine test_master() subroutine test_parallel_master integer :: c = 2 -!WARNING: OpenMP directive PARALLEL MASTER has been deprecated, please use PARALLEL MASKED instead. +!WARNING: OpenMP directive PARALLEL MASTER has been deprecated, please use PARALLEL MASKED instead. [-Wopen-mp-usage] !$omp parallel master c = c + 2 !$omp end parallel master @@ -20,7 +20,7 @@ subroutine test_parallel_master subroutine test_master_taskloop_simd() integer :: i, j = 1 -!WARNING: OpenMP directive MASTER TASKLOOP SIMD has been deprecated, please use MASKED TASKLOOP SIMD instead. +!WARNING: OpenMP directive MASTER TASKLOOP SIMD has been deprecated, please use MASKED TASKLOOP SIMD instead. [-Wopen-mp-usage] !$omp master taskloop simd do i=1,10 j = j + 1 @@ -30,7 +30,7 @@ subroutine test_master_taskloop_simd() subroutine test_master_taskloop integer :: i, j = 1 -!WARNING: OpenMP directive MASTER TASKLOOP has been deprecated, please use MASKED TASKLOOP instead. +!WARNING: OpenMP directive MASTER TASKLOOP has been deprecated, please use MASKED TASKLOOP instead. [-Wopen-mp-usage] !$omp master taskloop do i=1,10 j = j + 1 @@ -40,7 +40,7 @@ subroutine test_master_taskloop subroutine test_parallel_master_taskloop_simd integer :: i, j = 1 -!WARNING: OpenMP directive PARALLEL MASTER TASKLOOP SIMD has been deprecated, please use PARALLEL_MASKED TASKLOOP SIMD instead. +!WARNING: OpenMP directive PARALLEL MASTER TASKLOOP SIMD has been deprecated, please use PARALLEL_MASKED TASKLOOP SIMD instead. [-Wopen-mp-usage] !$omp parallel master taskloop simd do i=1,10 j = j + 1 @@ -50,7 +50,7 @@ subroutine test_parallel_master_taskloop_simd subroutine test_parallel_master_taskloop integer :: i, j = 1 -!WARNING: OpenMP directive PARALLEL MASTER TASKLOOP has been deprecated, please use PARALLEL MASKED TASKLOOP instead. +!WARNING: OpenMP directive PARALLEL MASTER TASKLOOP has been deprecated, please use PARALLEL MASKED TASKLOOP instead. [-Wopen-mp-usage] !$omp parallel master taskloop do i=1,10 j = j + 1 diff --git a/flang/test/Semantics/OpenMP/nested-target.f90 b/flang/test/Semantics/OpenMP/nested-target.f90 index 6a56a84f4f570..a82b6c01b1968 100644 --- a/flang/test/Semantics/OpenMP/nested-target.f90 +++ b/flang/test/Semantics/OpenMP/nested-target.f90 @@ -10,7 +10,7 @@ program main real, allocatable :: B(:) !$omp target - !PORTABILITY: If TARGET UPDATE directive is nested inside TARGET region, the behaviour is unspecified + !PORTABILITY: If TARGET UPDATE directive is nested inside TARGET region, the behaviour is unspecified [-Wopen-mp-usage] !$omp target update from(arrayA) to(arrayB) do i = 1, 512 arrayA(i) = arrayB(i) @@ -20,7 +20,7 @@ program main !$omp parallel !$omp target !$omp parallel - !PORTABILITY: If TARGET UPDATE directive is nested inside TARGET region, the behaviour is unspecified + !PORTABILITY: If TARGET UPDATE directive is nested inside TARGET region, the behaviour is unspecified [-Wopen-mp-usage] !$omp target update from(arrayA) to(arrayB) do i = 1, 512 arrayA(i) = arrayB(i) @@ -30,7 +30,7 @@ program main !$omp end parallel !$omp target - !PORTABILITY: If TARGET DATA directive is nested inside TARGET region, the behaviour is unspecified + !PORTABILITY: If TARGET DATA directive is nested inside TARGET region, the behaviour is unspecified [-Wopen-mp-usage] !$omp target data map(to: a) do i = 1, N a = 3.14 @@ -40,12 +40,12 @@ program main allocate(B(N)) !$omp target - !PORTABILITY: If TARGET ENTER DATA directive is nested inside TARGET region, the behaviour is unspecified + !PORTABILITY: If TARGET ENTER DATA directive is nested inside TARGET region, the behaviour is unspecified [-Wopen-mp-usage] !$omp target enter data map(alloc:B) !$omp end target !$omp target - !PORTABILITY: If TARGET EXIT DATA directive is nested inside TARGET region, the behaviour is unspecified + !PORTABILITY: If TARGET EXIT DATA directive is nested inside TARGET region, the behaviour is unspecified [-Wopen-mp-usage] !$omp target exit data map(delete:B) !$omp end target deallocate(B) @@ -53,7 +53,7 @@ program main n1 = 10 n2 = 10 !$omp target teams map(to:a) - !PORTABILITY: If TARGET DATA directive is nested inside TARGET region, the behaviour is unspecified + !PORTABILITY: If TARGET DATA directive is nested inside TARGET region, the behaviour is unspecified [-Wopen-mp-usage] !ERROR: Only `DISTRIBUTE`, `PARALLEL`, or `LOOP` regions are allowed to be strictly nested inside `TEAMS` region. !$omp target data map(n1,n2) do i=1, n1 @@ -65,7 +65,7 @@ program main !$omp end target teams !$omp target teams map(to:a) map(from:n1,n2) - !PORTABILITY: If TARGET TEAMS DISTRIBUTE PARALLEL DO directive is nested inside TARGET region, the behaviour is unspecified + !PORTABILITY: If TARGET TEAMS DISTRIBUTE PARALLEL DO directive is nested inside TARGET region, the behaviour is unspecified [-Wopen-mp-usage] !ERROR: Only `DISTRIBUTE`, `PARALLEL`, or `LOOP` regions are allowed to be strictly nested inside `TEAMS` region. !$omp target teams distribute parallel do do i=1, n1 diff --git a/flang/test/Semantics/OpenMP/requires04.f90 b/flang/test/Semantics/OpenMP/requires04.f90 index 1fbb3aa6219bc..6eb0fb7f046a2 100644 --- a/flang/test/Semantics/OpenMP/requires04.f90 +++ b/flang/test/Semantics/OpenMP/requires04.f90 @@ -6,7 +6,7 @@ subroutine f integer, save :: x - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to(x) device_type(nohost) !$omp declare target enter(x) device_type(nohost) end subroutine f diff --git a/flang/test/Semantics/OpenMP/requires05.f90 b/flang/test/Semantics/OpenMP/requires05.f90 index f410f0104d899..0e2352ead0597 100644 --- a/flang/test/Semantics/OpenMP/requires05.f90 +++ b/flang/test/Semantics/OpenMP/requires05.f90 @@ -5,7 +5,7 @@ ! device constructs, such as declare target with 'to' clause and no device_type. subroutine f - !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. + !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead. [-Wopen-mp-usage] !$omp declare target to(f) !$omp declare target enter(f) end subroutine f diff --git a/flang/test/Semantics/OpenMP/single03.f90 b/flang/test/Semantics/OpenMP/single03.f90 index dc2c2fd27eb04..789fcfdd88080 100644 --- a/flang/test/Semantics/OpenMP/single03.f90 +++ b/flang/test/Semantics/OpenMP/single03.f90 @@ -39,7 +39,7 @@ subroutine omp_single !$omp single private(j) copyprivate(j) print *, "omp single", j !ERROR: COPYPRIVATE variable 'j' may not appear on a PRIVATE or FIRSTPRIVATE clause on a SINGLE construct - !WARNING: The COPYPRIVATE clause with 'j' is already used on the SINGLE directive + !WARNING: The COPYPRIVATE clause with 'j' is already used on the SINGLE directive [-Wopen-mp-usage] !$omp end single copyprivate(j) !$omp single nowait diff --git a/flang/test/Semantics/OpenMP/single04.f90 b/flang/test/Semantics/OpenMP/single04.f90 index 9505745c600e9..eabfe54b8ee3f 100644 --- a/flang/test/Semantics/OpenMP/single04.f90 +++ b/flang/test/Semantics/OpenMP/single04.f90 @@ -52,20 +52,20 @@ program single !ERROR: NOWAIT clause must not be used with COPYPRIVATE clause on the SINGLE directive !$omp single copyprivate(x) nowait print *, x - !WARNING: The COPYPRIVATE clause with 'x' is already used on the SINGLE directive + !WARNING: The COPYPRIVATE clause with 'x' is already used on the SINGLE directive [-Wopen-mp-usage] !ERROR: At most one NOWAIT clause can appear on the SINGLE directive !$omp end single copyprivate(x) nowait !$omp single copyprivate(x) print *, x - !WARNING: The COPYPRIVATE clause with 'x' is already used on the SINGLE directive + !WARNING: The COPYPRIVATE clause with 'x' is already used on the SINGLE directive [-Wopen-mp-usage] !ERROR: NOWAIT clause must not be used with COPYPRIVATE clause on the SINGLE directive !$omp end single copyprivate(x) nowait !ERROR: NOWAIT clause must not be used with COPYPRIVATE clause on the SINGLE directive !$omp single copyprivate(x, y) nowait print *, x - !WARNING: The COPYPRIVATE clause with 'x' is already used on the SINGLE directive + !WARNING: The COPYPRIVATE clause with 'x' is already used on the SINGLE directive [-Wopen-mp-usage] !ERROR: 'z' appears in more than one COPYPRIVATE clause on the END SINGLE directive !ERROR: At most one NOWAIT clause can appear on the SINGLE directive !$omp end single copyprivate(x, z) copyprivate(z) nowait @@ -73,9 +73,9 @@ program single !ERROR: NOWAIT clause must not be used with COPYPRIVATE clause on the SINGLE directive !$omp single copyprivate(x) nowait copyprivate(y) copyprivate(z) print *, x - !WARNING: The COPYPRIVATE clause with 'x' is already used on the SINGLE directive - !WARNING: The COPYPRIVATE clause with 'y' is already used on the SINGLE directive - !WARNING: The COPYPRIVATE clause with 'z' is already used on the SINGLE directive + !WARNING: The COPYPRIVATE clause with 'x' is already used on the SINGLE directive [-Wopen-mp-usage] + !WARNING: The COPYPRIVATE clause with 'y' is already used on the SINGLE directive [-Wopen-mp-usage] + !WARNING: The COPYPRIVATE clause with 'z' is already used on the SINGLE directive [-Wopen-mp-usage] !ERROR: At most one NOWAIT clause can appear on the SINGLE directive !$omp end single copyprivate(x, y, z) nowait end program diff --git a/flang/test/Semantics/OpenMP/target01.f90 b/flang/test/Semantics/OpenMP/target01.f90 index 545cc8a7b69f8..f6e7c6a67d41f 100644 --- a/flang/test/Semantics/OpenMP/target01.f90 +++ b/flang/test/Semantics/OpenMP/target01.f90 @@ -39,19 +39,19 @@ subroutine bar(b1, b2, b3) type(c_ptr), pointer :: b2 type(c_ptr), value :: b3 - !WARNING: Variable 'c' in IS_DEVICE_PTR clause must be a dummy argument. This semantic check is deprecated from OpenMP 5.2 and later. + !WARNING: Variable 'c' in IS_DEVICE_PTR clause must be a dummy argument. This semantic check is deprecated from OpenMP 5.2 and later. [-Wopen-mp-usage] !$omp target is_device_ptr(c) y = y + 1 !$omp end target - !WARNING: Variable 'b1' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute. This semantic check is deprecated from OpenMP 5.2 and later. + !WARNING: Variable 'b1' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute. This semantic check is deprecated from OpenMP 5.2 and later. [-Wopen-mp-usage] !$omp target is_device_ptr(b1) y = y + 1 !$omp end target - !WARNING: Variable 'b2' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute. This semantic check is deprecated from OpenMP 5.2 and later. + !WARNING: Variable 'b2' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute. This semantic check is deprecated from OpenMP 5.2 and later. [-Wopen-mp-usage] !$omp target is_device_ptr(b2) y = y + 1 !$omp end target - !WARNING: Variable 'b3' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute. This semantic check is deprecated from OpenMP 5.2 and later. + !WARNING: Variable 'b3' in IS_DEVICE_PTR clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute. This semantic check is deprecated from OpenMP 5.2 and later. [-Wopen-mp-usage] !$omp target is_device_ptr(b3) y = y + 1 !$omp end target diff --git a/flang/test/Semantics/OpenMP/threadprivate03.f90 b/flang/test/Semantics/OpenMP/threadprivate03.f90 index b466a8e05e9c2..81e26ee327a9d 100644 --- a/flang/test/Semantics/OpenMP/threadprivate03.f90 +++ b/flang/test/Semantics/OpenMP/threadprivate03.f90 @@ -13,7 +13,7 @@ program main !ERROR: The module name or main program name cannot be in a THREADPRIVATE directive !$omp threadprivate(mod1) - !PORTABILITY: Name 'main' declared in a main program should not have the same name as the main program + !PORTABILITY: Name 'main' declared in a main program should not have the same name as the main program [-Wbenign-name-clash] !ERROR: The module name or main program name cannot be in a THREADPRIVATE directive !$omp threadprivate(main) diff --git a/flang/test/Semantics/OpenMP/use_device_ptr1.f90 b/flang/test/Semantics/OpenMP/use_device_ptr1.f90 index 5a5437e618450..ed0a1d238c96d 100644 --- a/flang/test/Semantics/OpenMP/use_device_ptr1.f90 +++ b/flang/test/Semantics/OpenMP/use_device_ptr1.f90 @@ -27,7 +27,7 @@ subroutine omp_target_data a = arrayB !$omp end target data - !WARNING: Use of non-C_PTR type 'a' in USE_DEVICE_PTR is deprecated, use USE_DEVICE_ADDR instead + !WARNING: Use of non-C_PTR type 'a' in USE_DEVICE_PTR is deprecated, use USE_DEVICE_ADDR instead [-Wopen-mp-usage] !$omp target data map(tofrom: a) use_device_ptr(a) a = 2 !$omp end target data diff --git a/flang/test/Semantics/allocate09.f90 b/flang/test/Semantics/allocate09.f90 index c6b3b58773b02..15ede202d55fd 100644 --- a/flang/test/Semantics/allocate09.f90 +++ b/flang/test/Semantics/allocate09.f90 @@ -85,9 +85,9 @@ subroutine C946(param_ca_4_assumed, param_ta_4_assumed, param_ca_4_deferred) allocate(deferredChar, source="abcd") allocate(deferredChar, mold=deferredChar) - !PORTABILITY: Character length of allocatable object in ALLOCATE should be the same as the SOURCE or MOLD + !PORTABILITY: Character length of allocatable object in ALLOCATE should be the same as the SOURCE or MOLD [-Wallocate-to-other-length] allocate(char2, source="a") - !PORTABILITY: Character length of allocatable object in ALLOCATE should be the same as the SOURCE or MOLD + !PORTABILITY: Character length of allocatable object in ALLOCATE should be the same as the SOURCE or MOLD [-Wallocate-to-other-length] allocate(char2, source="abc") allocate(char2, mold=deferredChar) diff --git a/flang/test/Semantics/argshape01.f90 b/flang/test/Semantics/argshape01.f90 index 19cca1ca4620a..a1766c216bdbd 100644 --- a/flang/test/Semantics/argshape01.f90 +++ b/flang/test/Semantics/argshape01.f90 @@ -113,7 +113,7 @@ program main !ERROR: Actual procedure argument has interface incompatible with dummy argument 's=': incompatible dummy argument #1: incompatible dummy data object shapes call s8c(s7) call s8c(s8) - !WARNING: Actual procedure argument has possible interface incompatibility with dummy argument 's=': possibly incompatible dummy argument #1: distinct dummy data object shapes + !WARNING: Actual procedure argument has possible interface incompatibility with dummy argument 's=': possibly incompatible dummy argument #1: distinct dummy data object shapes [-Wproc-dummy-arg-shapes] call s8c(s8b) call s9c(s9) call s9c(s9b) @@ -154,7 +154,7 @@ program main !ERROR: Procedure pointer 'ps7' associated with incompatible procedure designator 's8': incompatible dummy argument #1: incompatible dummy data object shapes ps7 => s8 ps8 => s8 - !WARNING: pointer 'ps8' and s8b may not be completely compatible procedures: possibly incompatible dummy argument #1: distinct dummy data object shapes + !WARNING: pointer 'ps8' and s8b may not be completely compatible procedures: possibly incompatible dummy argument #1: distinct dummy data object shapes [-Wproc-dummy-arg-shapes] ps8 => s8b !ERROR: Procedure pointer 'ps8' associated with incompatible procedure designator 's6': incompatible dummy argument #1: incompatible dummy data object shapes ps8 => s6 diff --git a/flang/test/Semantics/assign02.f90 b/flang/test/Semantics/assign02.f90 index 9fa672025bfe7..f998197aeab58 100644 --- a/flang/test/Semantics/assign02.f90 +++ b/flang/test/Semantics/assign02.f90 @@ -85,7 +85,7 @@ subroutine s5 real, pointer, volatile :: q p => x !ERROR: Pointer must be VOLATILE when target is a VOLATILE coarray - !ERROR: VOLATILE target associated with non-VOLATILE pointer + !ERROR: VOLATILE target associated with non-VOLATILE pointer [-Wnon-volatile-pointer-to-volatile] p => y !ERROR: Pointer may not be VOLATILE when target is a non-VOLATILE coarray q => x @@ -175,7 +175,7 @@ subroutine s12 real, volatile, target :: x real, pointer :: p real, pointer, volatile :: q - !ERROR: VOLATILE target associated with non-VOLATILE pointer + !ERROR: VOLATILE target associated with non-VOLATILE pointer [-Wnon-volatile-pointer-to-volatile] p => x q => x end @@ -188,11 +188,11 @@ subroutine s13 real, pointer, volatile :: q1 type(t2), pointer, volatile :: q2 type(t3), pointer, volatile :: q3 - !ERROR: VOLATILE target associated with non-VOLATILE pointer + !ERROR: VOLATILE target associated with non-VOLATILE pointer [-Wnon-volatile-pointer-to-volatile] p1 => y%t3Field%t2Field - !ERROR: VOLATILE target associated with non-VOLATILE pointer + !ERROR: VOLATILE target associated with non-VOLATILE pointer [-Wnon-volatile-pointer-to-volatile] p2 => y%t3Field - !ERROR: VOLATILE target associated with non-VOLATILE pointer + !ERROR: VOLATILE target associated with non-VOLATILE pointer [-Wnon-volatile-pointer-to-volatile] p3 => y !OK: q1 => y%t3Field%t2Field @@ -200,9 +200,9 @@ subroutine s13 q2 => y%t3Field !OK: q3 => y - !ERROR: VOLATILE target associated with non-VOLATILE pointer + !ERROR: VOLATILE target associated with non-VOLATILE pointer [-Wnon-volatile-pointer-to-volatile] p3%t3FieldPtr => y%t3Field - !ERROR: VOLATILE target associated with non-VOLATILE pointer + !ERROR: VOLATILE target associated with non-VOLATILE pointer [-Wnon-volatile-pointer-to-volatile] p3%t3FieldPtr%t2FieldPtr => y%t3Field%t2Field !OK q3%t3FieldPtr => y%t3Field diff --git a/flang/test/Semantics/assign09.f90 b/flang/test/Semantics/assign09.f90 index b29e67a473e13..7c95e3a64ea57 100644 --- a/flang/test/Semantics/assign09.f90 +++ b/flang/test/Semantics/assign09.f90 @@ -49,9 +49,9 @@ elemental real function userElemental(a) realToRealProcPtr => noInterfaceExternal ! ok intToRealProcPtr => noInterfaceExternal !ok call sub1(noInterfaceExternal) ! ok - !WARNING: Actual procedure argument has an implicit interface which is not known to be compatible with dummy argument 'p=' which has an explicit interface + !WARNING: Actual procedure argument has an implicit interface which is not known to be compatible with dummy argument 'p=' which has an explicit interface [-Wimplicit-interface-actual] call sub2(noInterfaceExternal) - !WARNING: Actual procedure argument has an implicit interface which is not known to be compatible with dummy argument 'p=' which has an explicit interface + !WARNING: Actual procedure argument has an implicit interface which is not known to be compatible with dummy argument 'p=' which has an explicit interface [-Wimplicit-interface-actual] call sub3(noInterfaceExternal) !ERROR: Procedure pointer 'nointerfaceprocptr' with implicit interface may not be associated with procedure designator 'userelemental' with explicit interface that cannot be called via an implicit interface diff --git a/flang/test/Semantics/associate01.f90 b/flang/test/Semantics/associate01.f90 index deafea695e84f..b51379bab3c30 100644 --- a/flang/test/Semantics/associate01.f90 +++ b/flang/test/Semantics/associate01.f90 @@ -13,7 +13,7 @@ module m1 function iptr(n) integer, intent(in), target :: n integer, pointer :: iptr - !WARNING: Pointer target is not a definable variable + !WARNING: Pointer target is not a definable variable [-Wpointer-to-undefinable] !BECAUSE: 'n' is an INTENT(IN) dummy argument iptr => n end function diff --git a/flang/test/Semantics/associated.f90 b/flang/test/Semantics/associated.f90 index 3f3f5488ad9fe..7cb6c240db226 100644 --- a/flang/test/Semantics/associated.f90 +++ b/flang/test/Semantics/associated.f90 @@ -123,15 +123,15 @@ subroutine test(assumedRank) lVar = associated(null(intAllocVar)) lVar = associated(null()) !OK lVar = associated(null(intPointerVar1)) !OK - !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a valid left-hand side of a pointer assignment statement + !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a valid left-hand side of a pointer assignment statement [-Wportability] !BECAUSE: 'NULL()' is a null pointer lVar = associated(null(), null()) !OK lVar = associated(intPointerVar1, null(intPointerVar2)) !OK lVar = associated(intPointerVar1, null()) !OK - !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a valid left-hand side of a pointer assignment statement + !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a valid left-hand side of a pointer assignment statement [-Wportability] !BECAUSE: 'NULL()' is a null pointer lVar = associated(null(), null(intPointerVar1)) !OK - !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a pointer + !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a pointer [-Wportability] lVar = associated(null(intPointerVar1), null()) !OK !ERROR: POINTER= argument of ASSOCIATED() must be a pointer lVar = associated(intVar) @@ -180,18 +180,18 @@ subroutine test(assumedRank) ! Functions (other than NULL) returning pointers lVar = associated(objPtrFunc(targetIntVar1)) ! ok - !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a pointer + !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a pointer [-Wportability] lVar = associated(objPtrFunc(targetIntVar1), targetIntVar1) ! ok - !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a pointer + !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a pointer [-Wportability] lVar = associated(objPtrFunc(targetIntVar1), objPtrFunc(targetIntVar1)) ! ok lVar = associated(procPtrFunc()) ! ok lVar = associated(procPtrFunc(), intFunc) ! ok lVar = associated(procPtrFunc(), procPtrFunc()) ! ok !ERROR: POINTER= argument 'objptrfunc(targetintvar1)' is an object pointer but the TARGET= argument 'intfunc' is not a variable - !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a pointer + !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a pointer [-Wportability] lVar = associated(objPtrFunc(targetIntVar1), intFunc) !ERROR: POINTER= argument 'objptrfunc(targetintvar1)' is an object pointer but the TARGET= argument 'procptrfunc()' is not a variable - !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a pointer + !PORTABILITY: POINTER= argument of ASSOCIATED() is required by some other compilers to be a pointer [-Wportability] lVar = associated(objPtrFunc(targetIntVar1), procPtrFunc()) !ERROR: POINTER= argument 'procptrfunc()' is a procedure pointer but the TARGET= argument 'objptrfunc(targetintvar1)' is not a procedure or procedure pointer lVar = associated(procPtrFunc(), objPtrFunc(targetIntVar1)) diff --git a/flang/test/Semantics/bind-c02.f90 b/flang/test/Semantics/bind-c02.f90 index 416d071542fe6..66e1f0b816b99 100644 --- a/flang/test/Semantics/bind-c02.f90 +++ b/flang/test/Semantics/bind-c02.f90 @@ -19,8 +19,8 @@ subroutine proc() !ERROR: Only variable and named common block can be in BIND statement bind(c) :: sub - !PORTABILITY: Global name 'm' conflicts with a module - !PORTABILITY: Name 'm' declared in a module should not have the same name as the module + !PORTABILITY: Global name 'm' conflicts with a module [-Wbenign-name-clash] + !PORTABILITY: Name 'm' declared in a module should not have the same name as the module [-Wbenign-name-clash] bind(c) :: m ! no error for implicit type variable type my_type diff --git a/flang/test/Semantics/bind-c04.f90 b/flang/test/Semantics/bind-c04.f90 index 27119e375ce05..86a925f0090ee 100644 --- a/flang/test/Semantics/bind-c04.f90 +++ b/flang/test/Semantics/bind-c04.f90 @@ -37,7 +37,7 @@ subroutine aproc2() bind(c) ! ok procedure(proc), bind(c) :: y - !WARNING: Attribute 'BIND(C)' cannot be used more than once + !WARNING: Attribute 'BIND(C)' cannot be used more than once [-Wredundant-attribute] !ERROR: A procedure pointer may not have a BIND attribute with a name procedure(proc), bind(c, name="pc8"), bind(c), pointer :: pc8 diff --git a/flang/test/Semantics/bind-c06.f90 b/flang/test/Semantics/bind-c06.f90 index ff78a4743deee..608d193ee04de 100644 --- a/flang/test/Semantics/bind-c06.f90 +++ b/flang/test/Semantics/bind-c06.f90 @@ -40,7 +40,7 @@ program main procedure, nopass :: b => s end type - ! WARNING: A derived type with the BIND attribute should not be empty + ! WARNING: A derived type with the BIND attribute should not be empty [-Wempty-bind-c-derived-type] type, bind(c) :: t5 end type @@ -71,7 +71,7 @@ program main end type type, bind(c) :: t10 - !WARNING: A CHARACTER component of an interoperable type should have length 1 + !WARNING: A CHARACTER component of an interoperable type should have length 1 [-Wbind-c-char-length] character(len=2) x end type type, bind(c) :: t11 @@ -79,7 +79,7 @@ program main character(kind=2) x end type type, bind(c) :: t12 - !PORTABILITY: A LOGICAL component of an interoperable type should have the interoperable KIND=C_BOOL + !PORTABILITY: A LOGICAL component of an interoperable type should have the interoperable KIND=C_BOOL [-Wlogical-vs-c-bool] logical(kind=8) x end type type, bind(c) :: t13 diff --git a/flang/test/Semantics/bind-c11.f90 b/flang/test/Semantics/bind-c11.f90 index 54021f68b3d8d..761a113fe7f76 100644 --- a/flang/test/Semantics/bind-c11.f90 +++ b/flang/test/Semantics/bind-c11.f90 @@ -8,7 +8,7 @@ module m real, allocatable, bind(c) :: x3(:) contains subroutine s1(x) bind(c) - !PORTABILITY: A BIND(C) LOGICAL dummy argument should have the interoperable KIND=C_BOOL + !PORTABILITY: A BIND(C) LOGICAL dummy argument should have the interoperable KIND=C_BOOL [-Wlogical-vs-c-bool] logical(2), intent(in), value :: x end subroutine s2(x) bind(c) diff --git a/flang/test/Semantics/bind-c13.f90 b/flang/test/Semantics/bind-c13.f90 index 81815c1a95efa..867d63fc0e30d 100644 --- a/flang/test/Semantics/bind-c13.f90 +++ b/flang/test/Semantics/bind-c13.f90 @@ -5,8 +5,8 @@ subroutine interop(ptr,ashape,arank,eshape,asize) bind(c) real, pointer, contiguous :: ptr(:) real, contiguous :: ashape(:) ! ok real, contiguous :: arank(..) ! ok - !PORTABILITY: CONTIGUOUS entity 'eshape' should be an array pointer, assumed-shape, or assumed-rank + !PORTABILITY: CONTIGUOUS entity 'eshape' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous] real, contiguous :: eshape(10) - !PORTABILITY: CONTIGUOUS entity 'asize' should be an array pointer, assumed-shape, or assumed-rank + !PORTABILITY: CONTIGUOUS entity 'asize' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous] real, contiguous :: asize(*) end diff --git a/flang/test/Semantics/bind-c17.f90 b/flang/test/Semantics/bind-c17.f90 index 8e0ecde67a0a5..34d21865d4e4c 100644 --- a/flang/test/Semantics/bind-c17.f90 +++ b/flang/test/Semantics/bind-c17.f90 @@ -4,7 +4,7 @@ module m end type contains subroutine sub(x) bind(c) - !PORTABILITY: The derived type of this interoperable object should be BIND(C) + !PORTABILITY: The derived type of this interoperable object should be BIND(C) [-Wportability] type(a), pointer, intent(in) :: x end end diff --git a/flang/test/Semantics/bindings01.f90 b/flang/test/Semantics/bindings01.f90 index dc44db09c4a6f..3283ac30eb075 100644 --- a/flang/test/Semantics/bindings01.f90 +++ b/flang/test/Semantics/bindings01.f90 @@ -4,7 +4,7 @@ module m !ERROR: An ABSTRACT derived type must be extensible - !PORTABILITY: A derived type with the BIND attribute should not be empty + !PORTABILITY: A derived type with the BIND attribute should not be empty [-Wempty-bind-c-derived-type] type, abstract, bind(c) :: badAbstract1 end type !ERROR: An ABSTRACT derived type must be extensible @@ -45,7 +45,7 @@ module m end type type, extends(intermediate) :: concrete2 ! ensure no false missing binding error end type - !WARNING: A derived type with the BIND attribute should not be empty + !WARNING: A derived type with the BIND attribute should not be empty [-Wempty-bind-c-derived-type] type, bind(c) :: inextensible1 end type !ERROR: The parent type is not extensible @@ -226,7 +226,7 @@ subroutine mysubr end subroutine subroutine test type(t) a(2) - !PORTABILITY: Base of NOPASS type-bound procedure reference should be scalar + !PORTABILITY: Base of NOPASS type-bound procedure reference should be scalar [-Wnopass-scalar-base] call a%tbp !ERROR: Base of procedure component reference must be scalar call a%pp diff --git a/flang/test/Semantics/bindings03.f90 b/flang/test/Semantics/bindings03.f90 index baa8432a2701e..b03caf0ac452f 100644 --- a/flang/test/Semantics/bindings03.f90 +++ b/flang/test/Semantics/bindings03.f90 @@ -15,9 +15,9 @@ program test use m procedure(sub), pointer :: p type(t) x - !PORTABILITY: Procedure binding 'sub' used as target of a pointer assignment + !PORTABILITY: Procedure binding 'sub' used as target of a pointer assignment [-Wbinding-as-procedure] p => x%sub - !PORTABILITY: Procedure binding 'sub' passed as an actual argument + !PORTABILITY: Procedure binding 'sub' passed as an actual argument [-Wbinding-as-procedure] call sub2(x%sub) contains subroutine sub2(s) diff --git a/flang/test/Semantics/block-data01.f90 b/flang/test/Semantics/block-data01.f90 index aa4ede787c17a..c75c63afcf8c2 100644 --- a/flang/test/Semantics/block-data01.f90 +++ b/flang/test/Semantics/block-data01.f90 @@ -7,7 +7,7 @@ block data foo !ERROR: An initialized variable in BLOCK DATA must be in a COMMON block integer :: notInCommon = 1 integer :: uninitialized ! ok - !PORTABILITY: Procedure pointer 'q' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'q' should not have an ELEMENTAL intrinsic as its interface [-Wportability] !ERROR: 'q' may not appear in a BLOCK DATA subprogram procedure(sin), pointer :: q => cos !ERROR: 'p' may not be a procedure as it is in a COMMON block diff --git a/flang/test/Semantics/boz-literal-constants.f90 b/flang/test/Semantics/boz-literal-constants.f90 index ee6919cb9ecd5..4d957d13f3f67 100644 --- a/flang/test/Semantics/boz-literal-constants.f90 +++ b/flang/test/Semantics/boz-literal-constants.f90 @@ -56,7 +56,7 @@ subroutine explicit(n, x, c) res = CMPLX (realpart, img, 4) res = CMPLX (B"0101", B"1111", 4) - !WARNING: underflow on REAL(8) to REAL(4) conversion + !WARNING: underflow on REAL(8) to REAL(4) conversion [-Wfolding-exception] dbl = DBLE(B"1111") dbl = DBLE(realpart) diff --git a/flang/test/Semantics/c7108.f90 b/flang/test/Semantics/c7108.f90 index c23a0abe3ee03..0b7148f4d6455 100644 --- a/flang/test/Semantics/c7108.f90 +++ b/flang/test/Semantics/c7108.f90 @@ -33,9 +33,9 @@ program p use m type(foo) x x = foo(); print *, x ! ok, not ambiguous - !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'bar0') is ambiguous with a structure constructor of the same name + !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'bar0') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor] x = foo(2); print *, x ! ambigous - !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'bar2') is ambiguous with a structure constructor of the same name + !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'bar2') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor] x = foo(3.); print *, x ! ambiguous due to data conversion x = foo(.true.); print *, x ! ok, not ambigous end diff --git a/flang/test/Semantics/c_f_pointer.f90 b/flang/test/Semantics/c_f_pointer.f90 index de5673f8dc1d9..e2d00536cdacb 100644 --- a/flang/test/Semantics/c_f_pointer.f90 +++ b/flang/test/Semantics/c_f_pointer.f90 @@ -46,12 +46,12 @@ program test call c_f_pointer(scalarC, multiDimIntF, shape=[1_8]) !ERROR: SHAPE= argument to C_F_POINTER() must be a rank-one array. call c_f_pointer(scalarC, multiDimIntF, shape=rankTwoArray) - !WARNING: FPTR= argument to C_F_POINTER() should not be unlimited polymorphic + !WARNING: FPTR= argument to C_F_POINTER() should not be unlimited polymorphic [-Winteroperability] call c_f_pointer(scalarC, unlimited) - !PORTABILITY: FPTR= argument to C_F_POINTER() should not have a derived type that is not BIND(C) + !PORTABILITY: FPTR= argument to C_F_POINTER() should not have a derived type that is not BIND(C) [-Wportability] call c_f_pointer(scalarC, notBindC) - !WARNING: FPTR= argument to C_F_POINTER() should not have the non-interoperable character length CHARACTER(KIND=1,LEN=2_8) + !WARNING: FPTR= argument to C_F_POINTER() should not have the non-interoperable character length CHARACTER(KIND=1,LEN=2_8) [-Wcharacter-interoperability] call c_f_pointer(scalarC, c2ptr) - !WARNING: FPTR= argument to C_F_POINTER() should not have the non-interoperable intrinsic type or kind CHARACTER(KIND=4,LEN=1_8) + !WARNING: FPTR= argument to C_F_POINTER() should not have the non-interoperable intrinsic type or kind CHARACTER(KIND=4,LEN=1_8) [-Winteroperability] call c_f_pointer(scalarC, unicodePtr) end program diff --git a/flang/test/Semantics/c_loc01.f90 b/flang/test/Semantics/c_loc01.f90 index a515a7a64f02a..da8a0e5bdd9e1 100644 --- a/flang/test/Semantics/c_loc01.f90 +++ b/flang/test/Semantics/c_loc01.f90 @@ -14,7 +14,7 @@ subroutine test(assumedType, poly, nclen, n) type(c_ptr) cp type(c_funptr) cfp real notATarget - !PORTABILITY: Procedure pointer 'pptr' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'pptr' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(sin), pointer :: pptr real, target :: arr(3) type(hasLen(1)), target :: clen @@ -41,9 +41,9 @@ subroutine test(assumedType, poly, nclen, n) cp = c_loc(nclen) !ERROR: C_LOC() argument may not be zero-length character cp = c_loc(ch(2:1)) - !WARNING: C_LOC() argument has non-interoperable character length + !WARNING: C_LOC() argument has non-interoperable character length [-Wcharacter-interoperability] cp = c_loc(ch) - !WARNING: C_LOC() argument has non-interoperable intrinsic type or kind + !WARNING: C_LOC() argument has non-interoperable intrinsic type or kind [-Winteroperability] cp = c_loc(unicode) cp = c_loc(ch(1:1)) ! ok cp = c_loc(deferred) ! ok diff --git a/flang/test/Semantics/call01.f90 b/flang/test/Semantics/call01.f90 index 67d14c3800671..6849c5f6500b1 100644 --- a/flang/test/Semantics/call01.f90 +++ b/flang/test/Semantics/call01.f90 @@ -119,16 +119,16 @@ end function nested end function subroutine s01(f1, f2, fp1, fp2, fp3) - !PORTABILITY: A dummy procedure pointer should not have assumed-length CHARACTER(*) result type + !PORTABILITY: A dummy procedure pointer should not have assumed-length CHARACTER(*) result type [-Wportability] character*(*) :: f1, f3, fp1 external :: f1, f3 pointer :: fp1, fp3 - !PORTABILITY: A dummy procedure pointer should not have assumed-length CHARACTER(*) result type + !PORTABILITY: A dummy procedure pointer should not have assumed-length CHARACTER(*) result type [-Wportability] procedure(character*(*)), pointer :: fp2 interface character*(*) function f2() end function - !PORTABILITY: A dummy procedure pointer should not have assumed-length CHARACTER(*) result type + !PORTABILITY: A dummy procedure pointer should not have assumed-length CHARACTER(*) result type [-Wportability] character*(*) function fp3() end function !ERROR: A function interface may not declare an assumed-length CHARACTER(*) result diff --git a/flang/test/Semantics/call02.f90 b/flang/test/Semantics/call02.f90 index 0ec5530f98089..18cc0ecdfd852 100644 --- a/flang/test/Semantics/call02.f90 +++ b/flang/test/Semantics/call02.f90 @@ -8,7 +8,7 @@ elemental real function elem(x) real, intent(in), value :: x end function subroutine subr(dummy) - !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(sin) :: dummy end subroutine subroutine badsubr(dummy) @@ -17,11 +17,11 @@ subroutine badsubr(dummy) procedure(elem) :: dummy end subroutine subroutine optionalsubr(dummy) - !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(sin), optional :: dummy end subroutine subroutine ptrsubr(dummy) - !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(sin), pointer, intent(in) :: dummy end subroutine end interface diff --git a/flang/test/Semantics/call03.f90 b/flang/test/Semantics/call03.f90 index 59513557324e5..1721b59986862 100644 --- a/flang/test/Semantics/call03.f90 +++ b/flang/test/Semantics/call03.f90 @@ -163,9 +163,9 @@ subroutine test06 ! 15.5.2.4(4) type(pdtWithDefault(3)) :: defaultVar3 type(pdtWithDefault(4)) :: defaultVar4 character :: ch1 - !ERROR: Actual argument variable length '1' is less than expected length '2' + !ERROR: Actual argument variable length '1' is less than expected length '2' [-Wshort-character-actual] call ch2(ch1) - !WARNING: Actual argument expression length '0' is less than expected length '2' + !WARNING: Actual argument expression length '0' is less than expected length '2' [-Wshort-character-actual] call ch2("") call pdtdefault(vardefault) !ERROR: Actual argument type 'pdt(n=3_4)' is not compatible with dummy argument type 'pdt' @@ -300,10 +300,10 @@ subroutine test12 ! 15.5.2.4(21) !ERROR: Actual argument associated with INTENT(IN OUT) dummy argument 'x=' is not definable !BECAUSE: Variable 'a(int(j,kind=8))' has a vector subscript call intentinout_arr(a(j)) - !WARNING: Actual argument associated with ASYNCHRONOUS dummy argument 'x=' is not definable + !WARNING: Actual argument associated with ASYNCHRONOUS dummy argument 'x=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: Variable 'a(int(j,kind=8))' has a vector subscript call asynchronous_arr(a(j)) - !WARNING: Actual argument associated with VOLATILE dummy argument 'x=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'x=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: Variable 'a(int(j,kind=8))' has a vector subscript call volatile_arr(a(j)) end subroutine @@ -386,9 +386,9 @@ subroutine test16() ! C1540 call contiguous(a) ! ok call pointer(a) ! ok call pointer(b) ! ok - !ERROR: VOLATILE target associated with non-VOLATILE pointer + !ERROR: VOLATILE target associated with non-VOLATILE pointer [-Wnon-volatile-pointer-to-volatile] call pointer(c) ! ok - !ERROR: VOLATILE target associated with non-VOLATILE pointer + !ERROR: VOLATILE target associated with non-VOLATILE pointer [-Wnon-volatile-pointer-to-volatile] call pointer(d) ! ok call valueassumedsize(a) ! ok call valueassumedsize(b) ! ok diff --git a/flang/test/Semantics/call05.f90 b/flang/test/Semantics/call05.f90 index a06fe4f196c8c..b9b463a44979d 100644 --- a/flang/test/Semantics/call05.f90 +++ b/flang/test/Semantics/call05.f90 @@ -73,9 +73,9 @@ subroutine test call sma(ma) ! ok call spp(pp) ! ok call spa(pa) ! ok - !PORTABILITY: If a POINTER or ALLOCATABLE actual argument is polymorphic, the corresponding dummy argument should also be so + !PORTABILITY: If a POINTER or ALLOCATABLE actual argument is polymorphic, the corresponding dummy argument should also be so [-Wpolymorphic-actual-allocatable-or-pointer-to-monomorphic-dummy] call smp(pp) - !PORTABILITY: If a POINTER or ALLOCATABLE actual argument is polymorphic, the corresponding dummy argument should also be so + !PORTABILITY: If a POINTER or ALLOCATABLE actual argument is polymorphic, the corresponding dummy argument should also be so [-Wpolymorphic-actual-allocatable-or-pointer-to-monomorphic-dummy] call sma(pa) !ERROR: If a POINTER or ALLOCATABLE dummy or actual argument is polymorphic, both must be so call spp(mp) diff --git a/flang/test/Semantics/call07.f90 b/flang/test/Semantics/call07.f90 index 92f2bdba882d5..7e29fb74dd615 100644 --- a/flang/test/Semantics/call07.f90 +++ b/flang/test/Semantics/call07.f90 @@ -19,17 +19,17 @@ subroutine s04(p) end subroutine subroutine test - !PORTABILITY: CONTIGUOUS entity 'a01' should be an array pointer, assumed-shape, or assumed-rank + !PORTABILITY: CONTIGUOUS entity 'a01' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous] real, pointer, contiguous :: a01 ! C830 real, pointer :: a02(:) real, target :: a03(10) real :: a04(10) ! not TARGET - !PORTABILITY: CONTIGUOUS entity 'scalar' should be an array pointer, assumed-shape, or assumed-rank + !PORTABILITY: CONTIGUOUS entity 'scalar' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous] real, contiguous :: scalar call s01(a03) ! ok !ERROR: CONTIGUOUS pointer dummy argument may not be associated with non-CONTIGUOUS pointer actual argument call s01(a02) - !WARNING: Target of CONTIGUOUS pointer association is not known to be contiguous + !WARNING: Target of CONTIGUOUS pointer association is not known to be contiguous [-Wpointer-to-possible-noncontiguous] call s01(a02(:)) !ERROR: CONTIGUOUS pointer may not be associated with a discontiguous target call s01(a03(::2)) diff --git a/flang/test/Semantics/call09.f90 b/flang/test/Semantics/call09.f90 index 58b2382f600ef..e7ff72f74de02 100644 --- a/flang/test/Semantics/call09.f90 +++ b/flang/test/Semantics/call09.f90 @@ -37,7 +37,7 @@ subroutine s05(p) end subroutine subroutine selemental1(p) - !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(cos) :: p ! ok end subroutine diff --git a/flang/test/Semantics/call10.f90 b/flang/test/Semantics/call10.f90 index 47976ca9630cd..a9b760cc692e6 100644 --- a/flang/test/Semantics/call10.f90 +++ b/flang/test/Semantics/call10.f90 @@ -62,7 +62,7 @@ pure real function f03a(a) real, pointer :: a ! ok end function pure real function f04(a) ! C1583 - !WARNING: non-POINTER dummy argument of pure function should be INTENT(IN) or VALUE + !WARNING: non-POINTER dummy argument of pure function should be INTENT(IN) or VALUE [-Wrelaxed-pure-dummy] real, intent(out) :: a end function pure real function f04a(a) diff --git a/flang/test/Semantics/call14.f90 b/flang/test/Semantics/call14.f90 index fba11d35790b2..ad67caa41b4ed 100644 --- a/flang/test/Semantics/call14.f90 +++ b/flang/test/Semantics/call14.f90 @@ -9,7 +9,7 @@ module m !ERROR: VALUE attribute may apply only to a dummy data object subroutine C863(notData,assumedSize,coarray,coarrayComponent,assumedRank,assumedLen) external :: notData - !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute + !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute [-Wignore-irrelevant-attributes] real, value :: notADummy value :: notData !ERROR: VALUE attribute may not apply to an assumed-size array @@ -20,7 +20,7 @@ subroutine C863(notData,assumedSize,coarray,coarrayComponent,assumedRank,assumed type(hasCoarray), value :: coarrayComponent !ERROR: VALUE attribute may not apply to an assumed-rank array real, value :: assumedRank(..) - !PORTABILITY: VALUE attribute on assumed-length CHARACTER may not be portable + !PORTABILITY: VALUE attribute on assumed-length CHARACTER may not be portable [-Wportability] character(*), value :: assumedLen end subroutine subroutine C864(allocatable, inout, out, pointer, volatile) diff --git a/flang/test/Semantics/call24.f90 b/flang/test/Semantics/call24.f90 index c1053db93648f..bdcf80a74b84a 100644 --- a/flang/test/Semantics/call24.f90 +++ b/flang/test/Semantics/call24.f90 @@ -38,7 +38,7 @@ subroutine test() !ERROR: References to the procedure 'bar' require an explicit interface !BECAUSE: a dummy procedure is optional or a pointer - !WARNING: If the procedure's interface were explicit, this reference would be in error + !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface] !BECAUSE: Actual argument associated with procedure pointer dummy argument 'a_pointer=' is not a procedure pointer call bar(sin) diff --git a/flang/test/Semantics/call27.f90 b/flang/test/Semantics/call27.f90 index f401eb254fde0..2559482cfe2b5 100644 --- a/flang/test/Semantics/call27.f90 +++ b/flang/test/Semantics/call27.f90 @@ -4,9 +4,9 @@ program test real, allocatable :: a !ERROR: NULL() actual argument 'NULL()' may not be associated with allocatable dummy argument dummy argument 'a=' that is INTENT(OUT) or INTENT(IN OUT) call foo0(null()) - !WARNING: NULL() actual argument 'NULL()' should not be associated with allocatable dummy argument dummy argument 'a=' without INTENT(IN) + !WARNING: NULL() actual argument 'NULL()' should not be associated with allocatable dummy argument dummy argument 'a=' without INTENT(IN) [-Wnull-actual-for-default-intent-allocatable] call foo1(null()) - !PORTABILITY: Allocatable dummy argument 'a=' is associated with NULL() + !PORTABILITY: Allocatable dummy argument 'a=' is associated with NULL() [-Wnull-actual-for-allocatable] call foo2(null()) call foo3(null()) ! ok !ERROR: Actual argument associated with INTENT(IN OUT) dummy argument 'a=' is not definable diff --git a/flang/test/Semantics/call30.f90 b/flang/test/Semantics/call30.f90 index 7aec5903606ec..1570eb02b6755 100644 --- a/flang/test/Semantics/call30.f90 +++ b/flang/test/Semantics/call30.f90 @@ -23,49 +23,49 @@ subroutine vol_dum_int_arr(my_int_arr) end subroutine vol_dum_int_arr subroutine test_all_subprograms() - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '6_4' is not a variable or pointer call vol_dum_int(6) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '18_4' is not a variable or pointer call vol_dum_int(6+12) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '72_4' is not a variable or pointer call vol_dum_int(6*12) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '-3_4' is not a variable or pointer call vol_dum_int(-6/2) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_real=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_real=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '3.1415927410125732421875_4' is not a variable or pointer call vol_dum_real(3.141592653) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_real=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_real=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '3.1415927410125732421875_4' is not a variable or pointer call vol_dum_real(3.141592653 + (-10.6e-11)) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_real=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_real=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '3.3300884272335906644002534449100494384765625e-10_4' is not a variable or pointer call vol_dum_real(3.141592653 * 10.6e-11) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_real=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_real=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '-2.9637666816e10_4' is not a variable or pointer call vol_dum_real(3.141592653 / (-10.6e-11)) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_complex=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_complex=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '(1._4,3.2000000476837158203125_4)' is not a variable or pointer call vol_dum_complex((1., 3.2)) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_complex=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_complex=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '(-1._4,6.340000152587890625_4)' is not a variable or pointer call vol_dum_complex((1., 3.2) + (-2., 3.14)) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_complex=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_complex=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '(-1.2048000335693359375e1_4,-3.2599999904632568359375_4)' is not a variable or pointer call vol_dum_complex((1., 3.2) * (-2., 3.14)) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_complex=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_complex=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '(5.80680549144744873046875e-1_4,-6.8833148479461669921875e-1_4)' is not a variable or pointer call vol_dum_complex((1., 3.2) / (-2., 3.14)) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int_arr=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int_arr=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '[INTEGER(4)::1_4,2_4,3_4,4_4]' is not a variable or pointer call vol_dum_int_arr((/ 1, 2, 3, 4 /)) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int_arr=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int_arr=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: 'reshape([INTEGER(4)::1_4,2_4,3_4,4_4],shape=[2,2])' is not a variable or pointer call vol_dum_int_arr(reshape((/ 1, 2, 3, 4 /), (/ 2, 2/))) - !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int_arr=' is not definable + !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int_arr=' is not definable [-Wundefinable-asynchronous-or-volatile-actual] !BECAUSE: '[INTEGER(4)::1_4,2_4,3_4,4_4]' is not a variable or pointer call vol_dum_int_arr((/ 1, 2, 3, 4 /)) end subroutine test_all_subprograms diff --git a/flang/test/Semantics/call31.f90 b/flang/test/Semantics/call31.f90 index d9fd2cc60ec33..71fecd5363457 100644 --- a/flang/test/Semantics/call31.f90 +++ b/flang/test/Semantics/call31.f90 @@ -4,7 +4,7 @@ module m contains subroutine subr(parg) - !PORTABILITY: A dummy procedure pointer should not have assumed-length CHARACTER(*) result type + !PORTABILITY: A dummy procedure pointer should not have assumed-length CHARACTER(*) result type [-Wportability] procedure(character(*)), pointer :: parg !ERROR: An assumed (*) type parameter may be used only for a (non-statement function) dummy argument, associate name, character named constant, or external function result procedure(character(*)), pointer :: plocal @@ -14,7 +14,7 @@ subroutine subr(parg) end subroutine subroutine subr_1(parg_1) - !PORTABILITY: A dummy procedure pointer should not have assumed-length CHARACTER(*) result type + !PORTABILITY: A dummy procedure pointer should not have assumed-length CHARACTER(*) result type [-Wportability] procedure(character(*)), pointer :: parg_1 print *, parg_1() end subroutine diff --git a/flang/test/Semantics/call33.f90 b/flang/test/Semantics/call33.f90 index 285c4be98a9db..05b7dfb8d8c42 100644 --- a/flang/test/Semantics/call33.f90 +++ b/flang/test/Semantics/call33.f90 @@ -29,7 +29,7 @@ program test character(4) long, longarr(1) character(4), allocatable :: longalloc character(4), pointer :: longptr - !WARNING: Actual argument variable length '2' is less than expected length '3' + !WARNING: Actual argument variable length '2' is less than expected length '3' [-Wshort-character-actual] call s1(short) !ERROR: Actual argument array has fewer characters (2) than dummy argument 'x=' array (3) call s2(shortarr) diff --git a/flang/test/Semantics/call34.f90 b/flang/test/Semantics/call34.f90 index 325a267309d46..a21536c6935fe 100644 --- a/flang/test/Semantics/call34.f90 +++ b/flang/test/Semantics/call34.f90 @@ -11,11 +11,11 @@ program test real, target :: a(1) real :: b(1) call foo(a) ! ok - !WARNING: Any pointer associated with TARGET dummy argument 'a=' during this call must not be used afterwards, as 'b' is not a target + !WARNING: Any pointer associated with TARGET dummy argument 'a=' during this call must not be used afterwards, as 'b' is not a target [-Wnon-target-passed-to-target] call foo(b) - !WARNING: Any pointer associated with TARGET dummy argument 'a=' during this call will not be associated with the value of '(a)' afterwards + !WARNING: Any pointer associated with TARGET dummy argument 'a=' during this call will not be associated with the value of '(a)' afterwards [-Wnon-target-passed-to-target] call foo((a)) - !WARNING: Any pointer associated with TARGET dummy argument 'a=' during this call will not be associated with the value of 'a([INTEGER(8)::1_8])' afterwards + !WARNING: Any pointer associated with TARGET dummy argument 'a=' during this call will not be associated with the value of 'a([INTEGER(8)::1_8])' afterwards [-Wnon-target-passed-to-target] call foo(a([1])) !ERROR: Scalar actual argument may not be associated with assumed-shape dummy argument 'a=' call foo(a(1)) diff --git a/flang/test/Semantics/call35.f90 b/flang/test/Semantics/call35.f90 index ff819481226d6..d500a3aef127d 100644 --- a/flang/test/Semantics/call35.f90 +++ b/flang/test/Semantics/call35.f90 @@ -5,14 +5,14 @@ subroutine s1 end subroutine s2 - !WARNING: Reference to the procedure 'ext' has an implicit interface that is distinct from another reference: distinct numbers of dummy arguments + !WARNING: Reference to the procedure 'ext' has an implicit interface that is distinct from another reference: distinct numbers of dummy arguments [-Wincompatible-implicit-interfaces] call ext(1.) call myerror('abcd') ! don't warn about distinct lengths end subroutine s3 interface - !WARNING: The global subprogram 'ext' is not compatible with its local procedure declaration (incompatible procedure attributes: ImplicitInterface) + !WARNING: The global subprogram 'ext' is not compatible with its local procedure declaration (incompatible procedure attributes: ImplicitInterface) [-Wexternal-interface-mismatch] subroutine ext(n) integer n end diff --git a/flang/test/Semantics/call36.f90 b/flang/test/Semantics/call36.f90 index 779aafdd2340a..387758408a841 100644 --- a/flang/test/Semantics/call36.f90 +++ b/flang/test/Semantics/call36.f90 @@ -15,7 +15,7 @@ subroutine test call intentInUnlimited(scalar) !ERROR: Actual argument associated with POINTER dummy argument 'x=' must also be POINTER unless INTENT(IN) call intentInOutUnlimited(scalar) - !PORTABILITY: If a POINTER or ALLOCATABLE dummy or actual argument is unlimited polymorphic, both should be so + !PORTABILITY: If a POINTER or ALLOCATABLE dummy or actual argument is unlimited polymorphic, both should be so [-Wrelaxed-intent-in-checking] call intentInUnlimited(arrayptr) !ERROR: If a POINTER or ALLOCATABLE dummy or actual argument is unlimited polymorphic, both must be so call intentInOutUnlimited(arrayptr) diff --git a/flang/test/Semantics/call37.f90 b/flang/test/Semantics/call37.f90 index 6018b8697ad5f..a536f62a1a7a8 100644 --- a/flang/test/Semantics/call37.f90 +++ b/flang/test/Semantics/call37.f90 @@ -28,15 +28,15 @@ subroutine exprLen(s) module m1 interface - !WARNING: The global subprogram 'constlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: incompatible dummy data object types: CHARACTER(KIND=1,LEN=1_8) vs CHARACTER(KIND=1,LEN=2_8)) + !WARNING: The global subprogram 'constlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: incompatible dummy data object types: CHARACTER(KIND=1,LEN=1_8) vs CHARACTER(KIND=1,LEN=2_8)) [-Wexternal-interface-mismatch] subroutine constLen(s) character(len=2) s end - !WARNING: The global subprogram 'assumedlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: assumed-length character vs explicit-length character) + !WARNING: The global subprogram 'assumedlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: assumed-length character vs explicit-length character) [-Wexternal-interface-mismatch] subroutine assumedLen(s) character(len=2) s end - !WARNING: The global subprogram 'exprlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: constant-length vs non-constant-length character dummy arguments) + !WARNING: The global subprogram 'exprlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: constant-length vs non-constant-length character dummy arguments) [-Wexternal-interface-mismatch] subroutine exprLen(s) character(len=2) s end @@ -45,11 +45,11 @@ subroutine exprLen(s) module m2 interface - !WARNING: The global subprogram 'constlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: assumed-length character vs explicit-length character) + !WARNING: The global subprogram 'constlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: assumed-length character vs explicit-length character) [-Wexternal-interface-mismatch] subroutine constLen(s) character(len=*) s end - !WARNING: The global subprogram 'exprlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: assumed-length character vs explicit-length character) + !WARNING: The global subprogram 'exprlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: assumed-length character vs explicit-length character) [-Wexternal-interface-mismatch] subroutine exprLen(s) character(len=*) s end @@ -58,12 +58,12 @@ subroutine exprLen(s) module m3 interface - !WARNING: The global subprogram 'constlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: constant-length vs non-constant-length character dummy arguments) + !WARNING: The global subprogram 'constlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: constant-length vs non-constant-length character dummy arguments) [-Wexternal-interface-mismatch] subroutine constLen(s) common n character(len=n) s end - !WARNING: The global subprogram 'assumedlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: assumed-length character vs explicit-length character) + !WARNING: The global subprogram 'assumedlen' is not compatible with its local procedure declaration (incompatible dummy argument #1: assumed-length character vs explicit-length character) [-Wexternal-interface-mismatch] subroutine assumedLen(s) common n character(len=n) s diff --git a/flang/test/Semantics/call38.f90 b/flang/test/Semantics/call38.f90 index b1a35973e35fe..4a00699779561 100644 --- a/flang/test/Semantics/call38.f90 +++ b/flang/test/Semantics/call38.f90 @@ -516,9 +516,9 @@ subroutine test !ERROR: Actual argument associated with coarray dummy argument 'a=' must be a coarray call coarray0(matrix11(1,1)) - !WARNING: Actual argument variable length '1' is less than expected length '2' + !WARNING: Actual argument variable length '1' is less than expected length '2' [-Wshort-character-actual] call scalar(scalar0(1:1)) - !WARNING: Actual argument expression length '1' is less than expected length '2' + !WARNING: Actual argument expression length '1' is less than expected length '2' [-Wshort-character-actual] call scalar('a') end end diff --git a/flang/test/Semantics/call41.f90 b/flang/test/Semantics/call41.f90 index a4c7514d99ba5..c26ef2899576f 100644 --- a/flang/test/Semantics/call41.f90 +++ b/flang/test/Semantics/call41.f90 @@ -5,7 +5,7 @@ subroutine unlimited(x) class(*), intent(in) :: x end subroutine test - !PORTABILITY: passing Hollerith to unlimited polymorphic as if it were CHARACTER + !PORTABILITY: passing Hollerith to unlimited polymorphic as if it were CHARACTER [-Whollerith-polymorphic] call unlimited(6HHERMAN) call unlimited('abc') ! ok end diff --git a/flang/test/Semantics/call42.f90 b/flang/test/Semantics/call42.f90 index 2d5303b58cb01..c264f8e842c5f 100644 --- a/flang/test/Semantics/call42.f90 +++ b/flang/test/Semantics/call42.f90 @@ -22,17 +22,17 @@ recursive subroutine typeOutAssumedRank(a,b,c,d) type(hasAlloc), intent(out) :: b(..) type(hasInit), intent(out) :: c(..) type(hasFinal), intent(out) :: d(..) - !PORTABILITY: Assumed-rank actual argument should not be associated with INTENT(OUT) assumed-rank dummy argument + !PORTABILITY: Assumed-rank actual argument should not be associated with INTENT(OUT) assumed-rank dummy argument [-Wportability] !ERROR: Assumed-rank actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization !ERROR: Assumed-rank actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization !ERROR: Assumed-rank actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization call typeOutAssumedRank(a, b, c, d) - !PORTABILITY: Assumed-rank actual argument should not be associated with INTENT(OUT) assumed-rank dummy argument + !PORTABILITY: Assumed-rank actual argument should not be associated with INTENT(OUT) assumed-rank dummy argument [-Wportability] !ERROR: Assumed-rank actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization !ERROR: Assumed-rank actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization !ERROR: Assumed-rank actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization call classOutAssumedRank(a, b, c, d) - !PORTABILITY: Assumed-rank actual argument should not be associated with INTENT(OUT) assumed-rank dummy argument + !PORTABILITY: Assumed-rank actual argument should not be associated with INTENT(OUT) assumed-rank dummy argument [-Wportability] !ERROR: Assumed-rank actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization !ERROR: Assumed-rank actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization !ERROR: Assumed-rank actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization @@ -95,17 +95,17 @@ subroutine typeAssumedSize(a,b,c,d) type(hasAlloc) b(*) type(hasInit) c(*) type(hasFinal) d(*) - !PORTABILITY: Assumed-size actual argument should not be associated with INTENT(OUT) assumed-rank dummy argument + !PORTABILITY: Assumed-size actual argument should not be associated with INTENT(OUT) assumed-rank dummy argument [-Wportability] !ERROR: Assumed-size actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization !ERROR: Assumed-size actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization !ERROR: Assumed-size actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization call typeOutAssumedRank(a,b,c,d) - !PORTABILITY: Assumed-size actual argument should not be associated with INTENT(OUT) assumed-rank dummy argument + !PORTABILITY: Assumed-size actual argument should not be associated with INTENT(OUT) assumed-rank dummy argument [-Wportability] !ERROR: Assumed-size actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization !ERROR: Assumed-size actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization !ERROR: Assumed-size actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization call classOutAssumedRank(a,b,c,d) - !PORTABILITY: Assumed-size actual argument should not be associated with INTENT(OUT) assumed-rank dummy argument + !PORTABILITY: Assumed-size actual argument should not be associated with INTENT(OUT) assumed-rank dummy argument [-Wportability] !ERROR: Assumed-size actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization !ERROR: Assumed-size actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization !ERROR: Assumed-size actual argument may not be associated with INTENT(OUT) assumed-rank dummy argument requiring finalization, destruction, or initialization diff --git a/flang/test/Semantics/call43.f90 b/flang/test/Semantics/call43.f90 index d8cc543a4838a..938ecb9a2a7db 100644 --- a/flang/test/Semantics/call43.f90 +++ b/flang/test/Semantics/call43.f90 @@ -5,11 +5,11 @@ subroutine from(a, b, c, d) call to(a) call to(a(1)) ! ok call to(b) ! ok, passed via temp - !WARNING: Reference to the procedure 'to' has an implicit interface that is distinct from another reference: incompatible dummy argument #1: incompatible dummy data object shapes + !WARNING: Reference to the procedure 'to' has an implicit interface that is distinct from another reference: incompatible dummy argument #1: incompatible dummy data object shapes [-Wincompatible-implicit-interfaces] call to(b(1)) - !WARNING: Reference to the procedure 'to' has an implicit interface that is distinct from another reference: incompatible dummy argument #1: incompatible dummy data object shapes + !WARNING: Reference to the procedure 'to' has an implicit interface that is distinct from another reference: incompatible dummy argument #1: incompatible dummy data object shapes [-Wincompatible-implicit-interfaces] call to(c) - !WARNING: Reference to the procedure 'to' has an implicit interface that is distinct from another reference: incompatible dummy argument #1: incompatible dummy data object shapes + !WARNING: Reference to the procedure 'to' has an implicit interface that is distinct from another reference: incompatible dummy argument #1: incompatible dummy data object shapes [-Wincompatible-implicit-interfaces] call to(1.) call to([1., 2.]) ! ok call to(d) ! ok diff --git a/flang/test/Semantics/call44.f90 b/flang/test/Semantics/call44.f90 index f7c4c9093b432..6e52aa9de55f7 100644 --- a/flang/test/Semantics/call44.f90 +++ b/flang/test/Semantics/call44.f90 @@ -2,10 +2,10 @@ subroutine assumedshape(normal, contig) real normal(:) real, contiguous :: contig(:) - !WARNING: If the procedure's interface were explicit, this reference would be in error + !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface] !BECAUSE: Element of assumed-shape array may not be associated with a dummy argument 'assumedsize=' array call seqAssociate(normal(1)) - !PORTABILITY: Element of contiguous assumed-shape array is accepted for storage sequence association + !PORTABILITY: Element of contiguous assumed-shape array is accepted for storage sequence association [-Wcontiguous-ok-for-seq-association] call seqAssociate(contig(1)) end subroutine seqAssociate(assumedSize) diff --git a/flang/test/Semantics/case01.f90 b/flang/test/Semantics/case01.f90 index 15bc30498ab51..c9631d299e49c 100644 --- a/flang/test/Semantics/case01.f90 +++ b/flang/test/Semantics/case01.f90 @@ -129,7 +129,7 @@ program selectCaseProg end select select case (grade2) - !WARNING: CASE has lower bound greater than upper bound + !WARNING: CASE has lower bound greater than upper bound [-Wempty-case] case (51:50) case (100:) case (:30) @@ -183,13 +183,13 @@ subroutine test_overflow integer :: j select case(1_1) case (127) - !WARNING: CASE value (128_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARNING: CASE value (128_4) overflows type (INTEGER(1)) of SELECT CASE expression [-Wcase-overflow] case (128) - !WARNING: CASE value (129_4) overflows type (INTEGER(1)) of SELECT CASE expression - !WARNING: CASE value (130_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARNING: CASE value (129_4) overflows type (INTEGER(1)) of SELECT CASE expression [-Wcase-overflow] + !WARNING: CASE value (130_4) overflows type (INTEGER(1)) of SELECT CASE expression [-Wcase-overflow] case (129:130) - !WARNING: CASE value (-130_4) overflows type (INTEGER(1)) of SELECT CASE expression - !WARNING: CASE value (-129_4) overflows type (INTEGER(1)) of SELECT CASE expression + !WARNING: CASE value (-130_4) overflows type (INTEGER(1)) of SELECT CASE expression [-Wcase-overflow] + !WARNING: CASE value (-129_4) overflows type (INTEGER(1)) of SELECT CASE expression [-Wcase-overflow] case (-130:-129) case (-128) !ERROR: Must be a scalar value, but is a rank-1 array diff --git a/flang/test/Semantics/common-blocks.f90 b/flang/test/Semantics/common-blocks.f90 index 65f17f6d3fe97..816a9039dd49f 100644 --- a/flang/test/Semantics/common-blocks.f90 +++ b/flang/test/Semantics/common-blocks.f90 @@ -7,7 +7,7 @@ subroutine init_1 common x, y common /a/ xa, ya common /b/ xb, yb - !WARNING: Blank COMMON object 'x' in a DATA statement is not standard + !WARNING: Blank COMMON object 'x' in a DATA statement is not standard [-Wdata-stmt-extensions] data x /42./, xa /42./, yb/42./ end subroutine @@ -18,7 +18,7 @@ subroutine init_conflict common /a/ xa, ya common /b/ xb, yb equivalence (yb, yb_eq) - !WARNING: Blank COMMON object 'x' in a DATA statement is not standard + !WARNING: Blank COMMON object 'x' in a DATA statement is not standard [-Wdata-stmt-extensions] !ERROR: Multiple initialization of COMMON block /b/ data x /66./, xa /66./, yb_eq /66./ end subroutine diff --git a/flang/test/Semantics/contiguous01.f90 b/flang/test/Semantics/contiguous01.f90 index 89382775261b8..eca5b4c69a601 100644 --- a/flang/test/Semantics/contiguous01.f90 +++ b/flang/test/Semantics/contiguous01.f90 @@ -5,30 +5,30 @@ module m0 end module m use m0 - !WARNING: Use-associated 'p1' already has 'CONTIGUOUS' attribute + !WARNING: Use-associated 'p1' already has 'CONTIGUOUS' attribute [-Wredundant-attribute] contiguous p1 !ERROR: Cannot change CONTIGUOUS attribute on use-associated 'p2' contiguous p2 - !PORTABILITY: CONTIGUOUS entity 'x' should be an array pointer, assumed-shape, or assumed-rank + !PORTABILITY: CONTIGUOUS entity 'x' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous] real, contiguous :: x - !PORTABILITY: CONTIGUOUS entity 'scalar' should be an array pointer, assumed-shape, or assumed-rank + !PORTABILITY: CONTIGUOUS entity 'scalar' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous] real, contiguous, pointer :: scalar - !PORTABILITY: CONTIGUOUS entity 'allocatable' should be an array pointer, assumed-shape, or assumed-rank + !PORTABILITY: CONTIGUOUS entity 'allocatable' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous] real, contiguous, allocatable :: allocatable contains - !PORTABILITY: CONTIGUOUS entity 'func' should be an array pointer, assumed-shape, or assumed-rank + !PORTABILITY: CONTIGUOUS entity 'func' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous] function func(ashape,arank) result(r) real, contiguous :: ashape(:) ! ok real, contiguous :: arank(..) ! ok - !PORTABILITY: CONTIGUOUS entity 'r' should be an array pointer, assumed-shape, or assumed-rank + !PORTABILITY: CONTIGUOUS entity 'r' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous] real :: r(10) - !PORTABILITY: CONTIGUOUS entity 'r2' should be an array pointer, assumed-shape, or assumed-rank + !PORTABILITY: CONTIGUOUS entity 'r2' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous] real :: r2(10) contiguous func contiguous r contiguous e contiguous r2 - !PORTABILITY: CONTIGUOUS entity 'e' should be an array pointer, assumed-shape, or assumed-rank + !PORTABILITY: CONTIGUOUS entity 'e' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous] entry e() result(r2) r2 = 0 end diff --git a/flang/test/Semantics/cuf01.cuf b/flang/test/Semantics/cuf01.cuf index 574d345eae045..fc405fcd3e36a 100644 --- a/flang/test/Semantics/cuf01.cuf +++ b/flang/test/Semantics/cuf01.cuf @@ -2,15 +2,15 @@ ! Test conflicting CUDA subprogram attributes module m1 contains - !WARNING: ATTRIBUTES(Host) appears more than once + !WARNING: ATTRIBUTES(Host) appears more than once [-Wredundant-attribute] attributes(host,host) subroutine ok1; end - !WARNING: ATTRIBUTES(Host) appears more than once + !WARNING: ATTRIBUTES(Host) appears more than once [-Wredundant-attribute] attributes(host) attributes(host) subroutine ok2; end attributes(host,device) subroutine ok3; end attributes(device,host) subroutine ok4; end - !WARNING: ATTRIBUTES(Host) appears more than once + !WARNING: ATTRIBUTES(Host) appears more than once [-Wredundant-attribute] attributes(host,device,host) subroutine ok5; end - !WARNING: ATTRIBUTES(Device) appears more than once + !WARNING: ATTRIBUTES(Device) appears more than once [-Wredundant-attribute] attributes(device,host,device) subroutine ok6; end !ERROR: ATTRIBUTES(Global) conflicts with earlier ATTRIBUTES(Host) attributes(host,global) subroutine conflict1; end diff --git a/flang/test/Semantics/cuf03.cuf b/flang/test/Semantics/cuf03.cuf index fe9dd5b3ecf05..d2a189f419299 100644 --- a/flang/test/Semantics/cuf03.cuf +++ b/flang/test/Semantics/cuf03.cuf @@ -38,14 +38,14 @@ module m !ERROR: Object 'mmp' with ATTRIBUTES(MANAGED) must also be allocatable, automatic, explicit shape, or a dummy argument real, managed, pointer :: mmp(:) real, managed, target :: mmt - !WARNING: Object 'mp' with ATTRIBUTES(PINNED) should also be allocatable + !WARNING: Object 'mp' with ATTRIBUTES(PINNED) should also be allocatable [-Wcuda-usage] real, pinned :: mp - !WARNING: Object 'mpi' with ATTRIBUTES(PINNED) should also be allocatable + !WARNING: Object 'mpi' with ATTRIBUTES(PINNED) should also be allocatable [-Wcuda-usage] real, pinned :: mpi = 1. real, pinned, allocatable :: mpl ! ok - !ERROR: Object 'mpp' with ATTRIBUTES(PINNED) may not be a pointer + !ERROR: Object 'mpp' with ATTRIBUTES(PINNED) may not be a pointer [-Wcuda-usage] real, pinned, pointer :: mpp - !WARNING: Object 'mpt' with ATTRIBUTES(PINNED) should also be allocatable + !WARNING: Object 'mpt' with ATTRIBUTES(PINNED) should also be allocatable [-Wcuda-usage] real, pinned, target :: mpt ! ok !ERROR: ATTRIBUTES(TEXTURE) is obsolete and no longer supported real, texture, pointer :: mt @@ -67,7 +67,7 @@ module m integer, intent(in) :: n real, device :: da(*) ! ok real, managed :: ma(n) ! ok - !WARNING: Pointer 'dp' may not be associated in a device subprogram + !WARNING: Pointer 'dp' may not be associated in a device subprogram [-Wcuda-usage] real, device, pointer :: dp real, constant :: rc ! ok real, shared :: rs ! ok diff --git a/flang/test/Semantics/cuf04.cuf b/flang/test/Semantics/cuf04.cuf index 2e2faa90b490d..3c9ee7388ab2d 100644 --- a/flang/test/Semantics/cuf04.cuf +++ b/flang/test/Semantics/cuf04.cuf @@ -4,9 +4,9 @@ module m contains attributes(device) subroutine devsubr(n) integer, intent(in) :: n - !WARNING: 'x1' should not have the SAVE attribute or initialization in a device subprogram + !WARNING: 'x1' should not have the SAVE attribute or initialization in a device subprogram [-Wcuda-usage] real, save :: x1 - !WARNING: 'x2' should not have the SAVE attribute or initialization in a device subprogram + !WARNING: 'x2' should not have the SAVE attribute or initialization in a device subprogram [-Wcuda-usage] real :: x2 = 1. !ERROR: Device subprogram 'devsubr' cannot call itself if (n > 0) call devsubr(n-1) diff --git a/flang/test/Semantics/cuf09.cuf b/flang/test/Semantics/cuf09.cuf index 1e23819f9afe8..9178b0a63adbe 100644 --- a/flang/test/Semantics/cuf09.cuf +++ b/flang/test/Semantics/cuf09.cuf @@ -15,7 +15,7 @@ module m print*,'from device' print '(f10.5)', (x(ivar), ivar = 1, 10) write(*,*), "Hello world from device!" - !WARNING: I/O statement might not be supported on device + !WARNING: I/O statement might not be supported on device [-Wcuda-usage] write(12,'(10F4.1)'), x end attributes(global) subroutine devsub3(n) diff --git a/flang/test/Semantics/data06.f90 b/flang/test/Semantics/data06.f90 index 08b4700028438..7ca514ec923f6 100644 --- a/flang/test/Semantics/data06.f90 +++ b/flang/test/Semantics/data06.f90 @@ -41,7 +41,7 @@ real function rfunc(x) data rp/rfunc/ procedure(rfunc), pointer :: rpp real, target :: rt - !WARNING: Procedure pointer 'rpp' in a DATA statement is not standard + !WARNING: Procedure pointer 'rpp' in a DATA statement is not standard [-Wdata-stmt-extensions] !ERROR: Data object 'rt' may not be used to initialize 'rpp', which is a procedure pointer data rpp/rt/ !ERROR: Initializer for 'rt' must not be a pointer @@ -49,7 +49,7 @@ real function rfunc(x) !ERROR: Initializer for 'rt' must not be a procedure data rt/rfunc/ integer :: jx, jy - !WARNING: DATA statement value initializes 'jx' of type 'INTEGER(4)' with CHARACTER + !WARNING: DATA statement value initializes 'jx' of type 'INTEGER(4)' with CHARACTER [-Wdata-stmt-extensions] data jx/'abc'/ !ERROR: DATA statement value could not be converted to the type 'INTEGER(4)' of the object 'jx' data jx/t1()/ diff --git a/flang/test/Semantics/data17.f90 b/flang/test/Semantics/data17.f90 index 86f1c4c6c1269..2f4e5fb02e6a9 100644 --- a/flang/test/Semantics/data17.f90 +++ b/flang/test/Semantics/data17.f90 @@ -1,8 +1,8 @@ ! RUN: %python %S/test_errors.py %s %flang_fc1 character(4) a, b, c, d, e, f -!WARNING: DATA statement value '"abcde"' for 'a' has the wrong length +!WARNING: DATA statement value '"abcde"' for 'a' has the wrong length [-Wdata-length] data a(1:4)/'abcde'/ -!WARNING: DATA statement value '"abc"' for 'b' has the wrong length +!WARNING: DATA statement value '"abc"' for 'b' has the wrong length [-Wdata-length] data b(1:4)/'abc'/ data c/'abcde'/ ! not a substring, conforms data d/'abc'/ ! not a substring, conforms diff --git a/flang/test/Semantics/declarations04.f90 b/flang/test/Semantics/declarations04.f90 index f0ca568e7a97c..5585b08904dd6 100644 --- a/flang/test/Semantics/declarations04.f90 +++ b/flang/test/Semantics/declarations04.f90 @@ -20,7 +20,7 @@ subroutine bar() bind(c,name="ext3") end block data ext3 - !PORTABILITY: Global name 'ext4' conflicts with a module + !PORTABILITY: Global name 'ext4' conflicts with a module [-Wbenign-name-clash] common /ext4/ x end diff --git a/flang/test/Semantics/declarations05.f90 b/flang/test/Semantics/declarations05.f90 index b1e3d3c773160..06191e165bce7 100644 --- a/flang/test/Semantics/declarations05.f90 +++ b/flang/test/Semantics/declarations05.f90 @@ -27,7 +27,7 @@ pure subroutine test !ERROR: 'x1' may not be a local variable in a pure subprogram !BECAUSE: 'x1' has an impure FINAL procedure 'final' type(t1) x1 - !WARNING: 'x1a' of derived type 't1' does not have a FINAL subroutine for its rank (1) + !WARNING: 'x1a' of derived type 't1' does not have a FINAL subroutine for its rank (1) [-Wfinal] type(t1), allocatable :: x1a(:) type(t1), parameter :: namedConst = t1() ! ok !ERROR: 'x2' may not be a local variable in a pure subprogram diff --git a/flang/test/Semantics/declarations07.f90 b/flang/test/Semantics/declarations07.f90 index 8c95c163b043b..75e5bcf22bafb 100644 --- a/flang/test/Semantics/declarations07.f90 +++ b/flang/test/Semantics/declarations07.f90 @@ -11,8 +11,8 @@ pure integer function mykind(x) real a, b integer, parameter :: ak = kind(a) integer, parameter :: br = rank(b) - !WARNING: 'a' appeared earlier as a scalar actual argument to a specification function + !WARNING: 'a' appeared earlier as a scalar actual argument to a specification function [-Wprevious-scalar-use] dimension a(1) - !WARNING: 'b' appeared earlier as a scalar actual argument to a specification function + !WARNING: 'b' appeared earlier as a scalar actual argument to a specification function [-Wprevious-scalar-use] dimension b(1) end diff --git a/flang/test/Semantics/deferred01.f90 b/flang/test/Semantics/deferred01.f90 index ce406a72b8fab..8117b91eef434 100644 --- a/flang/test/Semantics/deferred01.f90 +++ b/flang/test/Semantics/deferred01.f90 @@ -19,7 +19,7 @@ module m2 use m1 type, extends(absBase) :: ext contains - !WARNING: Override of PRIVATE DEFERRED 'deferredtbp' should appear in its module + !WARNING: Override of PRIVATE DEFERRED 'deferredtbp' should appear in its module [-Winaccessible-deferred-override] procedure :: deferredTbp => implTbp end type contains diff --git a/flang/test/Semantics/definable02.f90 b/flang/test/Semantics/definable02.f90 index 666fee91a97de..559efb0dbb003 100644 --- a/flang/test/Semantics/definable02.f90 +++ b/flang/test/Semantics/definable02.f90 @@ -36,9 +36,9 @@ program test x1(:) = [t1()] ! ok x2(:) = [t2()] ! ok x3(:) = [t3()] ! ok - !PORTABILITY: Variable 'x1([INTEGER(8)::1_8])' has a vector subscript and will be finalized by non-elemental subroutine 'f1' + !PORTABILITY: Variable 'x1([INTEGER(8)::1_8])' has a vector subscript and will be finalized by non-elemental subroutine 'f1' [-Wvector-subscript-finalization] x1([1]) = [t1()] - !PORTABILITY: Variable 'x2([INTEGER(8)::1_8])' has a vector subscript and will be finalized by non-elemental subroutine 'f2' + !PORTABILITY: Variable 'x2([INTEGER(8)::1_8])' has a vector subscript and will be finalized by non-elemental subroutine 'f2' [-Wvector-subscript-finalization] x2([1]) = [t2()] x3([1]) = [t3()] ! ok end diff --git a/flang/test/Semantics/dim01.f90 b/flang/test/Semantics/dim01.f90 index aba9a15b95a41..c00cd39ecd097 100644 --- a/flang/test/Semantics/dim01.f90 +++ b/flang/test/Semantics/dim01.f90 @@ -16,21 +16,21 @@ function f0b(a) function f1(a,d) real, intent(in) :: a(:) integer, optional, intent(in) :: d - !PORTABILITY: The actual argument for DIM= is optional, pointer, or allocatable, and it is assumed to be present and equal to 1 at execution time + !PORTABILITY: The actual argument for DIM= is optional, pointer, or allocatable, and it is assumed to be present and equal to 1 at execution time [-Woptional-must-be-present] f1 = sum(a,dim=d) - !PORTABILITY: The actual argument for DIM= is optional, pointer, or allocatable, and it is assumed to be present and equal to 1 at execution time + !PORTABILITY: The actual argument for DIM= is optional, pointer, or allocatable, and it is assumed to be present and equal to 1 at execution time [-Woptional-must-be-present] f1 = norm2(a,dim=d) end function function f2(a,d) real, intent(in) :: a(:) integer, pointer, intent(in) :: d - !PORTABILITY: The actual argument for DIM= is optional, pointer, or allocatable, and it is assumed to be present and equal to 1 at execution time + !PORTABILITY: The actual argument for DIM= is optional, pointer, or allocatable, and it is assumed to be present and equal to 1 at execution time [-Woptional-must-be-present] f2 = sum(a,dim=d) end function function f3(a,d) real, intent(in) :: a(:) integer, allocatable, intent(in) :: d - !PORTABILITY: The actual argument for DIM= is optional, pointer, or allocatable, and it is assumed to be present and equal to 1 at execution time + !PORTABILITY: The actual argument for DIM= is optional, pointer, or allocatable, and it is assumed to be present and equal to 1 at execution time [-Woptional-must-be-present] f3 = sum(a,dim=d) end function function f10a(a) @@ -49,23 +49,23 @@ function f11(a,d) real, intent(in) :: a(:,:) integer, optional, intent(in) :: d real, allocatable :: f11(:) - !WARNING: The actual argument for DIM= is optional, pointer, or allocatable, and may not be absent during execution; parenthesize to silence this warning + !WARNING: The actual argument for DIM= is optional, pointer, or allocatable, and may not be absent during execution; parenthesize to silence this warning [-Woptional-must-be-present] f11 = sum(a,dim=d) - !WARNING: The actual argument for DIM= is optional, pointer, or allocatable, and may not be absent during execution; parenthesize to silence this warning + !WARNING: The actual argument for DIM= is optional, pointer, or allocatable, and may not be absent during execution; parenthesize to silence this warning [-Woptional-must-be-present] f11 = norm2(a,dim=d) end function function f12(a,d) real, intent(in) :: a(:,:) integer, pointer, intent(in) :: d real, allocatable :: f12(:) - !WARNING: The actual argument for DIM= is optional, pointer, or allocatable, and may not be absent during execution; parenthesize to silence this warning + !WARNING: The actual argument for DIM= is optional, pointer, or allocatable, and may not be absent during execution; parenthesize to silence this warning [-Woptional-must-be-present] f12 = sum(a,dim=d) end function function f13(a,d) real, intent(in) :: a(:,:) integer, allocatable, intent(in) :: d real, allocatable :: f13(:) - !WARNING: The actual argument for DIM= is optional, pointer, or allocatable, and may not be absent during execution; parenthesize to silence this warning + !WARNING: The actual argument for DIM= is optional, pointer, or allocatable, and may not be absent during execution; parenthesize to silence this warning [-Woptional-must-be-present] f13 = sum(a,dim=d) end function end module diff --git a/flang/test/Semantics/dosemantics02.f90 b/flang/test/Semantics/dosemantics02.f90 index d6075a8a3f8f8..2e7713db28ef4 100644 --- a/flang/test/Semantics/dosemantics02.f90 +++ b/flang/test/Semantics/dosemantics02.f90 @@ -23,12 +23,12 @@ SUBROUTINE s1() INTEGER, PARAMETER :: constInt = 0 ! Warn on this one for backwards compatibility - !WARNING: DO step expression should not be zero + !WARNING: DO step expression should not be zero [-Wzero-do-step] DO 10 I = 1, 10, 0 10 CONTINUE ! Warn on this one for backwards compatibility - !WARNING: DO step expression should not be zero + !WARNING: DO step expression should not be zero [-Wzero-do-step] DO 20 I = 1, 10, 5 - 5 20 CONTINUE diff --git a/flang/test/Semantics/dosemantics03.f90 b/flang/test/Semantics/dosemantics03.f90 index a36c86b202c48..a2ec1135d7b16 100644 --- a/flang/test/Semantics/dosemantics03.f90 +++ b/flang/test/Semantics/dosemantics03.f90 @@ -50,13 +50,13 @@ END FUNCTION ifunc END DO ! REAL DO variable -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO rvar = 1, 10, 3 PRINT *, "rvar is: ", rvar END DO ! DOUBLE PRECISISON DO variable -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO dvar = 1, 10, 3 PRINT *, "dvar is: ", dvar END DO @@ -69,14 +69,14 @@ END FUNCTION ifunc ! Pointer to REAL DO variable ALLOCATE(prvar) -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO prvar = 1, 10, 3 PRINT *, "prvar is: ", prvar END DO ! Pointer to DOUBLE PRECISION DO variable ALLOCATE(pdvar) -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO pdvar = 1, 10, 3 PRINT *, "pdvar is: ", pdvar END DO @@ -148,26 +148,26 @@ END FUNCTION ifunc END DO ! Shared association REAL DO variable -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO realvarshare = 1, 10, 3 PRINT *, "ivar is: ", ivar END DO ! Shared association DOUBLE PRECISION DO variable -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO dpvarshare = 1, 10, 3 PRINT *, "ivar is: ", ivar END DO ! Initial expressions ! REAL initial expression -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO ivar = rvar, 10, 3 PRINT *, "ivar is: ", ivar END DO ! DOUBLE PRECISION initial expression -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO ivar = dvar, 10, 3 PRINT *, "ivar is: ", ivar END DO @@ -178,13 +178,13 @@ END FUNCTION ifunc END DO ! Pointer to REAL initial expression -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO ivar = prvar, 10, 3 PRINT *, "ivar is: ", ivar END DO ! Pointer to DOUBLE PRECISION initial expression -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO ivar = pdvar, 10, 3 PRINT *, "ivar is: ", ivar END DO @@ -221,13 +221,13 @@ END FUNCTION ifunc ! Final expression ! REAL final expression -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO ivar = 1, rvar, 3 PRINT *, "ivar is: ", ivar END DO ! DOUBLE PRECISION final expression -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO ivar = 1, dvar, 3 PRINT *, "ivar is: ", ivar END DO @@ -238,13 +238,13 @@ END FUNCTION ifunc END DO ! Pointer to REAL final expression -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO ivar = 1, prvar, 3 PRINT *, "ivar is: ", ivar END DO ! Pointer to DOUBLE PRECISION final expression -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO ivar = pdvar, 10, 3 PRINT *, "ivar is: ", ivar END DO @@ -263,13 +263,13 @@ END FUNCTION ifunc ! Step expression ! REAL step expression -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO ivar = 1, 10, rvar PRINT *, "ivar is: ", ivar END DO ! DOUBLE PRECISION step expression -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO ivar = 1, 10, dvar PRINT *, "ivar is: ", ivar END DO @@ -280,13 +280,13 @@ END FUNCTION ifunc END DO ! Pointer to REAL step expression -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO ivar = 1, 10, prvar PRINT *, "ivar is: ", ivar END DO ! Pointer to DOUBLE PRECISION step expression -!PORTABILITY: DO controls should be INTEGER +!PORTABILITY: DO controls should be INTEGER [-Wreal-do-controls] DO ivar = 1, 10, pdvar PRINT *, "ivar is: ", ivar END DO diff --git a/flang/test/Semantics/dosemantics12.f90 b/flang/test/Semantics/dosemantics12.f90 index 1757ade4b7c8f..3416142dd1b69 100644 --- a/flang/test/Semantics/dosemantics12.f90 +++ b/flang/test/Semantics/dosemantics12.f90 @@ -316,7 +316,7 @@ subroutine s9() ! Technically non-conformant (F'2023 19.4 p8) do concurrent (ivar = 1:10) print *, "hello" - !PORTABILITY: Index variable 'ivar' should not also be an index in an enclosing FORALL or DO CONCURRENT + !PORTABILITY: Index variable 'ivar' should not also be an index in an enclosing FORALL or DO CONCURRENT [-Wodd-index-variable-restrictions] do concurrent (ivar = 1:10) print *, "hello" end do @@ -392,7 +392,7 @@ subroutine s12() call intentInOutSub(jvar, ivar) do ivar = 1,10 - !WARNING: Possible redefinition of DO variable 'ivar' + !WARNING: Possible redefinition of DO variable 'ivar' [-Windex-var-redefinition] call intentInOutSub(jvar, ivar) end do @@ -437,7 +437,7 @@ subroutine s13() end do do ivar = 1, 10 - !WARNING: Possible redefinition of DO variable 'ivar' + !WARNING: Possible redefinition of DO variable 'ivar' [-Windex-var-redefinition] jvar = intentInOutFunc(ivar) end do diff --git a/flang/test/Semantics/expr-errors05.f90 b/flang/test/Semantics/expr-errors05.f90 index 0328165a7921e..43133c836f3b4 100644 --- a/flang/test/Semantics/expr-errors05.f90 +++ b/flang/test/Semantics/expr-errors05.f90 @@ -1,16 +1,16 @@ ! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror -pedantic -!PORTABILITY: nonstandard usage: generalized COMPLEX constructor -!PORTABILITY: Real part of complex constructor is not scalar +!PORTABILITY: nonstandard usage: generalized COMPLEX constructor [-Wcomplex-constructor] +!PORTABILITY: Real part of complex constructor is not scalar [-Wcomplex-constructor] complex, parameter :: z1(*) = ([1.,2.], 3.) -!PORTABILITY: nonstandard usage: generalized COMPLEX constructor -!PORTABILITY: Imaginary part of complex constructor is not scalar +!PORTABILITY: nonstandard usage: generalized COMPLEX constructor [-Wcomplex-constructor] +!PORTABILITY: Imaginary part of complex constructor is not scalar [-Wcomplex-constructor] complex, parameter :: z2(*) = (4., [5.,6.]) real, parameter :: aa(*) = [7.,8.] -!PORTABILITY: Real part of complex literal constant is not scalar +!PORTABILITY: Real part of complex literal constant is not scalar [-Wcomplex-constructor] complex, parameter :: z3(*) = (aa, 9.) -!PORTABILITY: Imaginary part of complex literal constant is not scalar +!PORTABILITY: Imaginary part of complex literal constant is not scalar [-Wcomplex-constructor] complex, parameter :: z4(*) = (10., aa) !We need a nonzero exit status to make test_errors.py look at messages :-( -!WARNING: division by zero +!WARNING: division by zero [-Wfolding-exception] real, parameter :: xxx = 1./0. end diff --git a/flang/test/Semantics/expr-errors06.f90 b/flang/test/Semantics/expr-errors06.f90 index 7d4283d35cdcb..c366060691556 100644 --- a/flang/test/Semantics/expr-errors06.f90 +++ b/flang/test/Semantics/expr-errors06.f90 @@ -43,6 +43,6 @@ subroutine subr(da) print *, empty(1:0,1) ! ok print *, empty(:,1) ! ok print *, empty(i:j,k) ! ok - !WARNING: Empty array dimension 1 should not be subscripted as an element or non-empty array section + !WARNING: Empty array dimension 1 should not be subscripted as an element or non-empty array section [-Wsubscripted-empty-array] print *, empty(i,1) end diff --git a/flang/test/Semantics/final03.f90 b/flang/test/Semantics/final03.f90 index 3c402540152bc..15335b2eeadcf 100644 --- a/flang/test/Semantics/final03.f90 +++ b/flang/test/Semantics/final03.f90 @@ -20,7 +20,7 @@ program test type(pdt(1)) x1(1) type(pdt(2)) x2(1) type(pdt(3)) x3(1) - !PORTABILITY: Variable 'x1([INTEGER(8)::1_8])' has a vector subscript and will be finalized by non-elemental subroutine 'finalarr' + !PORTABILITY: Variable 'x1([INTEGER(8)::1_8])' has a vector subscript and will be finalized by non-elemental subroutine 'finalarr' [-Wvector-subscript-finalization] x1([1]) = pdt(1)() x2([1]) = pdt(2)() ! ok, doesn't match either x3([1]) = pdt(3)() ! ok, calls finalElem diff --git a/flang/test/Semantics/forall01.f90 b/flang/test/Semantics/forall01.f90 index 72ad9ecd39471..d95328709ef48 100644 --- a/flang/test/Semantics/forall01.f90 +++ b/flang/test/Semantics/forall01.f90 @@ -10,7 +10,7 @@ subroutine forall1 a(i) = i end forall forall (j=1:8) - !PORTABILITY: Index variable 'j' should not also be an index in an enclosing FORALL or DO CONCURRENT + !PORTABILITY: Index variable 'j' should not also be an index in an enclosing FORALL or DO CONCURRENT [-Wodd-index-variable-restrictions] forall (j=1:9) end forall end forall @@ -41,7 +41,7 @@ subroutine forall3 forall(i=1:10) forall(j=1:10) !ERROR: Cannot redefine FORALL variable 'i' - !WARNING: FORALL index variable 'j' not used on left-hand side of assignment + !WARNING: FORALL index variable 'j' not used on left-hand side of assignment [-Wunused-forall-index] i = 1 end forall end forall @@ -80,20 +80,20 @@ subroutine forall5 x(i) = y(i) end forall forall(i=1:10) - !WARNING: FORALL index variable 'i' not used on left-hand side of assignment + !WARNING: FORALL index variable 'i' not used on left-hand side of assignment [-Wunused-forall-index] x = y forall(j=1:10) - !WARNING: FORALL index variable 'j' not used on left-hand side of assignment + !WARNING: FORALL index variable 'j' not used on left-hand side of assignment [-Wunused-forall-index] x(i) = y(i) - !WARNING: FORALL index variable 'i' not used on left-hand side of assignment + !WARNING: FORALL index variable 'i' not used on left-hand side of assignment [-Wunused-forall-index] x(j) = y(j) endforall endforall do concurrent(i=1:10) x = y !Odd rule from F'2023 19.4 p8 - !PORTABILITY: Index variable 'i' should not also be an index in an enclosing FORALL or DO CONCURRENT - !WARNING: FORALL index variable 'i' not used on left-hand side of assignment + !PORTABILITY: Index variable 'i' should not also be an index in an enclosing FORALL or DO CONCURRENT [-Wodd-index-variable-restrictions] + !WARNING: FORALL index variable 'i' not used on left-hand side of assignment [-Wunused-forall-index] forall(i=1:10) x = y end do end @@ -106,7 +106,7 @@ subroutine forall6 real, target :: b(10) forall(i=1:10) a(i)%p => b(i) - !WARNING: FORALL index variable 'i' not used on left-hand side of assignment + !WARNING: FORALL index variable 'i' not used on left-hand side of assignment [-Wunused-forall-index] a(1)%p => b(i) end forall end @@ -116,20 +116,20 @@ subroutine forall7(x) real :: a(10) class(*) :: x associate (j => iarr(1)) - !PORTABILITY: Index variable 'j' should be a scalar object or common block if it is present in the enclosing scope + !PORTABILITY: Index variable 'j' should be a scalar object or common block if it is present in the enclosing scope [-Wodd-index-variable-restrictions] forall (j=1:size(a)) a(j) = a(j) + 1 end forall end associate associate (j => iarr(1) + 1) - !PORTABILITY: Index variable 'j' should be a scalar object or common block if it is present in the enclosing scope + !PORTABILITY: Index variable 'j' should be a scalar object or common block if it is present in the enclosing scope [-Wodd-index-variable-restrictions] forall (j=1:size(a)) a(j) = a(j) + 1 end forall end associate select type (j => x) type is (integer) - !PORTABILITY: Index variable 'j' should be a scalar object or common block if it is present in the enclosing scope + !PORTABILITY: Index variable 'j' should be a scalar object or common block if it is present in the enclosing scope [-Wodd-index-variable-restrictions] forall (j=1:size(a)) a(j) = a(j) + 1 end forall diff --git a/flang/test/Semantics/forall02.f90 b/flang/test/Semantics/forall02.f90 index c4f4311a175a3..17e61769dc37a 100644 --- a/flang/test/Semantics/forall02.f90 +++ b/flang/test/Semantics/forall02.f90 @@ -35,7 +35,7 @@ subroutine s1() ! Error to invoke an IMPURE FINAL procedure in a FORALL forall (i = 1:10) - !WARNING: FORALL index variable 'i' not used on left-hand side of assignment + !WARNING: FORALL index variable 'i' not used on left-hand side of assignment [-Wunused-forall-index] !ERROR: Impure procedure 'impuresub' is referenced by finalization in a FORALL ifvar = ifvar1 end forall @@ -46,7 +46,7 @@ subroutine s1() end forall forall (i = 1:5) - !WARNING: FORALL index variable 'i' not used on left-hand side of assignment + !WARNING: FORALL index variable 'i' not used on left-hand side of assignment [-Wunused-forall-index] !ERROR: Impure procedure 'impuresubrank1' is referenced by finalization in a FORALL ifArr1 = if0 end forall @@ -57,7 +57,7 @@ subroutine s1() end forall forall (i = 1:5) - !WARNING: FORALL index variable 'i' not used on left-hand side of assignment + !WARNING: FORALL index variable 'i' not used on left-hand side of assignment [-Wunused-forall-index] !ERROR: Impure procedure 'impuresubrank2' is referenced by finalization in a FORALL ifArr2(:,:) = if0 end forall diff --git a/flang/test/Semantics/generic03.f90 b/flang/test/Semantics/generic03.f90 index 829780f52174f..c5a2156c365d2 100644 --- a/flang/test/Semantics/generic03.f90 +++ b/flang/test/Semantics/generic03.f90 @@ -15,7 +15,7 @@ integer function f1(x, j) program test use m1 - !WARNING: Generic interface 'g1' has both a function and a subroutine + !WARNING: Generic interface 'g1' has both a function and a subroutine [-Wsubroutine-and-function-specifics] interface g1 subroutine s1(x, a) import t1 diff --git a/flang/test/Semantics/generic06.f90 b/flang/test/Semantics/generic06.f90 index b47d442f3549e..30dc05fc09f90 100644 --- a/flang/test/Semantics/generic06.f90 +++ b/flang/test/Semantics/generic06.f90 @@ -1,11 +1,11 @@ ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic module m - !PORTABILITY: Specific procedure 'sin' of generic interface 'yintercept' should not be INTRINSIC + !PORTABILITY: Specific procedure 'sin' of generic interface 'yintercept' should not be INTRINSIC [-Wintrinsic-as-specific] intrinsic sin interface yIntercept procedure sin end interface - !PORTABILITY: Specific procedure 'cos' of generic interface 'xintercept' should not be INTRINSIC + !PORTABILITY: Specific procedure 'cos' of generic interface 'xintercept' should not be INTRINSIC [-Wintrinsic-as-specific] intrinsic cos generic :: xIntercept => cos end module diff --git a/flang/test/Semantics/global01.f90 b/flang/test/Semantics/global01.f90 index ab3edf9ef805f..ee7b170f577bc 100644 --- a/flang/test/Semantics/global01.f90 +++ b/flang/test/Semantics/global01.f90 @@ -30,7 +30,7 @@ recursive function global6() program test interface - !WARNING: The global subprogram 'global1' is not compatible with its local procedure declaration (incompatible dummy argument #1: incompatible dummy data object types: INTEGER(4) vs REAL(4)) + !WARNING: The global subprogram 'global1' is not compatible with its local procedure declaration (incompatible dummy argument #1: incompatible dummy data object types: INTEGER(4) vs REAL(4)) [-Wexternal-interface-mismatch] subroutine global1(x) real, intent(in) :: x end subroutine @@ -43,7 +43,7 @@ subroutine global3(x) bind(c,name="abc") subroutine global4(x) ! not PURE, but that's ok integer, intent(in) :: x end subroutine - !WARNING: The global subprogram 'global5' is not compatible with its local procedure declaration (incompatible procedure attributes: Pure) + !WARNING: The global subprogram 'global5' is not compatible with its local procedure declaration (incompatible procedure attributes: Pure) [-Wexternal-interface-mismatch] pure subroutine global5(x) integer, intent(in) :: x end subroutine diff --git a/flang/test/Semantics/ichar01.f90 b/flang/test/Semantics/ichar01.f90 index 5eb25a97e6d93..d3609652165b8 100644 --- a/flang/test/Semantics/ichar01.f90 +++ b/flang/test/Semantics/ichar01.f90 @@ -5,9 +5,9 @@ print *, iachar('') print *, ichar('a') print *, iachar('a') -!PORTABILITY: Character in intrinsic function ichar should have length one +!PORTABILITY: Character in intrinsic function ichar should have length one [-Wportability] print *, ichar('ab') -!PORTABILITY: Character in intrinsic function iachar should have length one +!PORTABILITY: Character in intrinsic function iachar should have length one [-Wportability] print *, iachar('ab') end diff --git a/flang/test/Semantics/ignore_tkr01.f90 b/flang/test/Semantics/ignore_tkr01.f90 index 2af4974b1c038..d069c97331bf6 100644 --- a/flang/test/Semantics/ignore_tkr01.f90 +++ b/flang/test/Semantics/ignore_tkr01.f90 @@ -53,13 +53,13 @@ subroutine t8(x) subroutine t9(x) !dir$ ignore_tkr x -!WARNING: !DIR$ IGNORE_TKR should not apply to an allocatable or pointer +!WARNING: !DIR$ IGNORE_TKR should not apply to an allocatable or pointer [-Wignore-tkr-usage] real, intent(in), allocatable :: x end subroutine t10(x) !dir$ ignore_tkr x -!WARNING: !DIR$ IGNORE_TKR should not apply to an allocatable or pointer +!WARNING: !DIR$ IGNORE_TKR should not apply to an allocatable or pointer [-Wignore-tkr-usage] real, intent(in), pointer :: x end @@ -88,7 +88,7 @@ elemental subroutine t13(x) subroutine t14(x) !dir$ ignore_tkr(r) x -!WARNING: !DIR$ IGNORE_TKR(R) should not apply to a dummy argument passed via descriptor +!WARNING: !DIR$ IGNORE_TKR(R) should not apply to a dummy argument passed via descriptor [-Wignore-tkr-usage] real x(:) end @@ -145,7 +145,7 @@ subroutine t20(x) subroutine t22(x) !dir$ ignore_tkr(r) x -!WARNING: !DIR$ IGNORE_TKR(R) is not meaningful for an assumed-rank array +!WARNING: !DIR$ IGNORE_TKR(R) is not meaningful for an assumed-rank array [-Wignore-tkr-usage] real x(..) end @@ -198,7 +198,7 @@ program test !ERROR: Actual argument type 'INTEGER(4)' is not compatible with dummy argument type 'REAL(4)' call t3(1) call t3(dx) - !ERROR: passing Hollerith or character literal as if it were BOZ + !ERROR: passing Hollerith or character literal as if it were BOZ [-Whollerith-or-character-as-boz] call t3('a') !ERROR: Actual argument type 'COMPLEX(4)' is not compatible with dummy argument type 'REAL(4)' call t3((1.,2.)) diff --git a/flang/test/Semantics/int-literals.f90 b/flang/test/Semantics/int-literals.f90 index 6d4a63e4bba71..7a386e0103b41 100644 --- a/flang/test/Semantics/int-literals.f90 +++ b/flang/test/Semantics/int-literals.f90 @@ -30,9 +30,9 @@ complex, parameter :: okz4a = (+2147483648_8, 0) complex, parameter :: okj4d = 2147483647, okz4d = (+2147483647, -2147483648) -!WARNING: Integer literal is too large for default INTEGER(KIND=4); assuming INTEGER(KIND=8) +!WARNING: Integer literal is too large for default INTEGER(KIND=4); assuming INTEGER(KIND=8) [-Wbig-int-literals] complex, parameter :: badj4dext = 2147483648 -!WARNING: Integer literal is too large for default INTEGER(KIND=4); assuming INTEGER(KIND=8) +!WARNING: Integer literal is too large for default INTEGER(KIND=4); assuming INTEGER(KIND=8) [-Wbig-int-literals] complex, parameter :: badz4dext = (+2147483648, 0) complex, parameter :: okj8 = 9223372036854775807_8, okz8 = (+9223372036854775807_8, -9223372036854775808_8) diff --git a/flang/test/Semantics/intrinsics02.f90 b/flang/test/Semantics/intrinsics02.f90 index 0b1f7c13a1564..615045d275812 100644 --- a/flang/test/Semantics/intrinsics02.f90 +++ b/flang/test/Semantics/intrinsics02.f90 @@ -17,7 +17,7 @@ pure real function mycos(x) end subroutine sameIntrinsic1 use explicit - !WARNING: Use-associated 'cos' already has 'INTRINSIC' attribute + !WARNING: Use-associated 'cos' already has 'INTRINSIC' attribute [-Wredundant-attribute] intrinsic cos real :: one = cos(0.) end diff --git a/flang/test/Semantics/kinds05b.f90 b/flang/test/Semantics/kinds05b.f90 index 3927829bbaab6..3f2d4605adbdf 100644 --- a/flang/test/Semantics/kinds05b.f90 +++ b/flang/test/Semantics/kinds05b.f90 @@ -8,8 +8,8 @@ subroutine s real :: realvar3 = 4.0_8 real :: realvar4 = 4.0E6_4 real :: realvar5 = 4.0E6_8 - !PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard + !PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard [-Wexponent-matching-kind-param] real :: realvar6 = 4.0D6_8 - !WARNING: Explicit kind parameter on real constant disagrees with exponent letter 'd' + !WARNING: Explicit kind parameter on real constant disagrees with exponent letter 'd' [-Wexponent-matching-kind-param] real :: realvar7 = 4.0D6_4 end subroutine s diff --git a/flang/test/Semantics/label18.f90 b/flang/test/Semantics/label18.f90 index a9f3e50237f98..152a189876b8a 100644 --- a/flang/test/Semantics/label18.f90 +++ b/flang/test/Semantics/label18.f90 @@ -9,10 +9,10 @@ program main 1 end if if (.true.) then do j = 1, 2 - !WARNING: Label '1' is in a construct that should not be used as a branch target here + !WARNING: Label '1' is in a construct that should not be used as a branch target here [-Wbranch-into-construct] goto 1 end do end if - !WARNING: Label '1' is in a construct that should not be used as a branch target here + !WARNING: Label '1' is in a construct that should not be used as a branch target here [-Wbranch-into-construct] goto 1 end diff --git a/flang/test/Semantics/local-vs-global.f90 b/flang/test/Semantics/local-vs-global.f90 index 3f7e9339639cc..21a3009ad7f29 100644 --- a/flang/test/Semantics/local-vs-global.f90 +++ b/flang/test/Semantics/local-vs-global.f90 @@ -46,24 +46,24 @@ function implicit_func_before_2(a) program test external justfine ! OK to name a BLOCK DATA if not called - !WARNING: The global entity 'module_before_1' corresponding to the local procedure 'module_before_1' is not a callable subprogram + !WARNING: The global entity 'module_before_1' corresponding to the local procedure 'module_before_1' is not a callable subprogram [-Wexternal-name-conflict] external module_before_1 - !WARNING: The global entity 'block_data_before_1' corresponding to the local procedure 'block_data_before_1' is not a callable subprogram + !WARNING: The global entity 'block_data_before_1' corresponding to the local procedure 'block_data_before_1' is not a callable subprogram [-Wexternal-name-conflict] external block_data_before_1 - !WARNING: The global subprogram 'explicit_before_1' should not be referenced via the implicit interface 'explicit_before_1' + !WARNING: The global subprogram 'explicit_before_1' should not be referenced via the implicit interface 'explicit_before_1' [-Wexternal-interface-mismatch] external explicit_before_1 external implicit_before_1 - !WARNING: The global subprogram 'explicit_func_before_1' should not be referenced via the implicit interface 'explicit_func_before_1' + !WARNING: The global subprogram 'explicit_func_before_1' should not be referenced via the implicit interface 'explicit_func_before_1' [-Wexternal-interface-mismatch] external explicit_func_before_1 external implicit_func_before_1 - !WARNING: The global entity 'module_after_1' corresponding to the local procedure 'module_after_1' is not a callable subprogram + !WARNING: The global entity 'module_after_1' corresponding to the local procedure 'module_after_1' is not a callable subprogram [-Wexternal-name-conflict] external module_after_1 - !WARNING: The global entity 'block_data_after_1' corresponding to the local procedure 'block_data_after_1' is not a callable subprogram + !WARNING: The global entity 'block_data_after_1' corresponding to the local procedure 'block_data_after_1' is not a callable subprogram [-Wexternal-name-conflict] external block_data_after_1 - !WARNING: The global subprogram 'explicit_after_1' should not be referenced via the implicit interface 'explicit_after_1' + !WARNING: The global subprogram 'explicit_after_1' should not be referenced via the implicit interface 'explicit_after_1' [-Wexternal-interface-mismatch] external explicit_after_1 external implicit_after_1 - !WARNING: The global subprogram 'explicit_func_after_1' should not be referenced via the implicit interface 'explicit_func_after_1' + !WARNING: The global subprogram 'explicit_func_after_1' should not be referenced via the implicit interface 'explicit_func_after_1' [-Wexternal-interface-mismatch] external explicit_func_after_1 external implicit_func_after_1 call module_before_1 @@ -76,20 +76,20 @@ program test !ERROR: References to the procedure 'explicit_before_2' require an explicit interface !BECAUSE: a dummy argument has the allocatable, asynchronous, optional, pointer, target, value, or volatile attribute call explicit_before_2(1.) - !WARNING: If the procedure's interface were explicit, this reference would be in error + !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface] !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference call implicit_before_1 - !WARNING: If the procedure's interface were explicit, this reference would be in error + !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface] !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference call implicit_before_2 print *, explicit_func_before_1(1.) !ERROR: References to the procedure 'explicit_func_before_2' require an explicit interface !BECAUSE: a dummy argument has the allocatable, asynchronous, optional, pointer, target, value, or volatile attribute print *, explicit_func_before_2(1.) - !WARNING: If the procedure's interface were explicit, this reference would be in error + !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface] !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference print *, implicit_func_before_1() - !WARNING: If the procedure's interface were explicit, this reference would be in error + !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface] !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference print *, implicit_func_before_2() call module_after_1 @@ -100,20 +100,20 @@ program test !ERROR: References to the procedure 'explicit_after_2' require an explicit interface !BECAUSE: a dummy argument has the allocatable, asynchronous, optional, pointer, target, value, or volatile attribute call explicit_after_2(1.) - !WARNING: If the procedure's interface were explicit, this reference would be in error + !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface] !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference call implicit_after_1 - !WARNING: If the procedure's interface were explicit, this reference would be in error + !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface] !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference call implicit_after_2 print *, explicit_func_after_1(1.) !ERROR: References to the procedure 'explicit_func_after_2' require an explicit interface !BECAUSE: a dummy argument has the allocatable, asynchronous, optional, pointer, target, value, or volatile attribute print *, explicit_func_after_2(1.) - !WARNING: If the procedure's interface were explicit, this reference would be in error + !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface] !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference print *, implicit_func_after_1() - !WARNING: If the procedure's interface were explicit, this reference would be in error + !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface] !BECAUSE: Dummy argument 'a=' (#1) is not OPTIONAL and is not associated with an actual argument in this procedure reference print *, implicit_func_after_2() end program diff --git a/flang/test/Semantics/long-name.f90 b/flang/test/Semantics/long-name.f90 index c406e366f76d4..44899b13edd5a 100644 --- a/flang/test/Semantics/long-name.f90 +++ b/flang/test/Semantics/long-name.f90 @@ -1,14 +1,14 @@ ! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror -pedantic -!PORTABILITY: aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg1 has length 64, which is greater than the maximum name length 63 +!PORTABILITY: aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg1 has length 64, which is greater than the maximum name length 63 [-Wlong-names] program aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg1 - !PORTABILITY: aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg2 has length 64, which is greater than the maximum name length 63 + !PORTABILITY: aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg2 has length 64, which is greater than the maximum name length 63 [-Wlong-names] integer :: aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg2 integer :: aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg - !PORTABILITY: aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg3 has length 64, which is greater than the maximum name length 63 + !PORTABILITY: aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg3 has length 64, which is greater than the maximum name length 63 [-Wlong-names] call aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg3 end diff --git a/flang/test/Semantics/modfile43.f90 b/flang/test/Semantics/modfile43.f90 index 1a50e94698f63..ed66dff27fb03 100644 --- a/flang/test/Semantics/modfile43.f90 +++ b/flang/test/Semantics/modfile43.f90 @@ -5,7 +5,7 @@ module iso_fortran_env end module module m1 use, intrinsic :: iso_fortran_env, only: int32 - !PORTABILITY: Should not USE the non-intrinsic module 'iso_fortran_env' in the same scope as a USE of the intrinsic module + !PORTABILITY: Should not USE the non-intrinsic module 'iso_fortran_env' in the same scope as a USE of the intrinsic module [-Wmisc-use-extensions] use, non_intrinsic :: iso_fortran_env, only: user_defined_123 end module module m2 diff --git a/flang/test/Semantics/null-init.f90 b/flang/test/Semantics/null-init.f90 index ad3f91679a427..d01ad75a75a11 100644 --- a/flang/test/Semantics/null-init.f90 +++ b/flang/test/Semantics/null-init.f90 @@ -37,7 +37,7 @@ module m6 module m7 interface - !WARNING: The external interface 'null' is not compatible with an earlier definition (incompatible procedure attributes: ImplicitInterface) + !WARNING: The external interface 'null' is not compatible with an earlier definition (incompatible procedure attributes: ImplicitInterface) [-Wexternal-interface-mismatch] function null() result(p) integer, pointer :: p end function diff --git a/flang/test/Semantics/null01.f90 b/flang/test/Semantics/null01.f90 index b21ee91a0be0a..64c9881297308 100644 --- a/flang/test/Semantics/null01.f90 +++ b/flang/test/Semantics/null01.f90 @@ -103,9 +103,9 @@ function f3() dt3x = dt3(pps1=null(mold=dt2x%pps0)) dt3x = dt3(pps1=null(mold=dt3x%pps1)) dt4x = dt4(null()) ! ok - !PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'ra0' + !PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'ra0' [-Wnull-mold-allocatable-component-value] dt4x = dt4(null(rp0)) - !PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'ra0' + !PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'ra0' [-Wnull-mold-allocatable-component-value] !ERROR: Rank-1 array value is not compatible with scalar component 'ra0' dt4x = dt4(null(rp1)) !ERROR: A NULL procedure pointer may not be used as the value for component 'ra0' @@ -133,7 +133,7 @@ function f3() print *, same_type_as(null(dt5p), null(dt4p)) ! ok !ERROR: A NULL() pointer is not allowed for 'source=' intrinsic argument print *, transfer(null(rp0),ip0) - !WARNING: Source of TRANSFER contains allocatable or pointer component %ra0 + !WARNING: Source of TRANSFER contains allocatable or pointer component %ra0 [-Wpointer-component-transfer-arg] print *, transfer(dt4(null()),[0]) !ERROR: NULL() may not be used as an expression in this context select case(null(ip0)) diff --git a/flang/test/Semantics/pointer01.f90 b/flang/test/Semantics/pointer01.f90 index cb860f3a3f437..eaa2426dd77e3 100644 --- a/flang/test/Semantics/pointer01.f90 +++ b/flang/test/Semantics/pointer01.f90 @@ -7,7 +7,7 @@ subroutine msubr end module program main use m - !PORTABILITY: Name 'main' declared in a main program should not have the same name as the main program + !PORTABILITY: Name 'main' declared in a main program should not have the same name as the main program [-Wbenign-name-clash] pointer main !ERROR: Cannot change POINTER attribute on use-associated 'mobj' pointer mobj diff --git a/flang/test/Semantics/procinterface02.f90 b/flang/test/Semantics/procinterface02.f90 index 8b1becbe081e5..6aa5dc13bd9a5 100644 --- a/flang/test/Semantics/procinterface02.f90 +++ b/flang/test/Semantics/procinterface02.f90 @@ -12,7 +12,7 @@ real function foo_nonelemental(x) end function end interface real :: A(:), B(:) - !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(sqrt), pointer :: P !ERROR: Rank of dummy argument is 0, but actual argument has rank 1 A = P(B) diff --git a/flang/test/Semantics/procinterface04.f90 b/flang/test/Semantics/procinterface04.f90 index f59e53f90dab1..fb48c4b17b419 100644 --- a/flang/test/Semantics/procinterface04.f90 +++ b/flang/test/Semantics/procinterface04.f90 @@ -9,11 +9,11 @@ pure real function nonelemental(x) real, intent(in) :: x end end interface - !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(sin) :: dp1 !ERROR: A dummy procedure may not be ELEMENTAL procedure(elemental) :: dp2 - !PORTABILITY: Procedure pointer 'pp1' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'pp1' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(sin), pointer :: pp1 !ERROR: Procedure pointer 'pp2' may not be ELEMENTAL procedure(elemental), pointer :: pp2 diff --git a/flang/test/Semantics/resolve05.f90 b/flang/test/Semantics/resolve05.f90 index 4e50feb64e4c3..0c9877af9b4e2 100644 --- a/flang/test/Semantics/resolve05.f90 +++ b/flang/test/Semantics/resolve05.f90 @@ -1,18 +1,18 @@ ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic program p - !PORTABILITY: Name 'p' declared in a main program should not have the same name as the main program + !PORTABILITY: Name 'p' declared in a main program should not have the same name as the main program [-Wbenign-name-clash] integer :: p end module m - !PORTABILITY: Name 'm' declared in a module should not have the same name as the module + !PORTABILITY: Name 'm' declared in a module should not have the same name as the module [-Wbenign-name-clash] integer :: m end submodule(m) sm - !PORTABILITY: Name 'sm' declared in a submodule should not have the same name as the submodule + !PORTABILITY: Name 'sm' declared in a submodule should not have the same name as the submodule [-Wbenign-name-clash] integer :: sm end block data bd - !PORTABILITY: Name 'bd' declared in a BLOCK DATA subprogram should not have the same name as the BLOCK DATA subprogram + !PORTABILITY: Name 'bd' declared in a BLOCK DATA subprogram should not have the same name as the BLOCK DATA subprogram [-Wbenign-name-clash] type bd end type end diff --git a/flang/test/Semantics/resolve108.f90 b/flang/test/Semantics/resolve108.f90 index 644b8fba86892..4ad53da5ddeb4 100644 --- a/flang/test/Semantics/resolve108.f90 +++ b/flang/test/Semantics/resolve108.f90 @@ -44,7 +44,7 @@ subroutine s2 use :: m2, only: foo !If we got the type of foo right, this declaration will fail !due to an attempted division by zero. - !WARNING: INTEGER(4) division by zero + !WARNING: INTEGER(4) division by zero [-Wfolding-exception] !ERROR: Must be a constant value integer, parameter :: test = 1 / (kind(foo(1)) - kind(1.d0)) end subroutine @@ -54,7 +54,7 @@ module m3 contains real(kind=kind(x)) function foo(x) real(kind=kind(1.0d0)) x - !WARNING: INTEGER(4) division by zero + !WARNING: INTEGER(4) division by zero [-Wfolding-exception] !ERROR: Must be a constant value integer, parameter :: test = 1 / (kind(foo) - kind(1.d0)) foo = n diff --git a/flang/test/Semantics/resolve11.f90 b/flang/test/Semantics/resolve11.f90 index 9ae4f52c4fd54..0c457f2c9f3f0 100644 --- a/flang/test/Semantics/resolve11.f90 +++ b/flang/test/Semantics/resolve11.f90 @@ -4,7 +4,7 @@ module m integer, private :: j !ERROR: The accessibility of 'i' has already been specified as PUBLIC private i - !WARNING: The accessibility of 'j' has already been specified as PRIVATE + !WARNING: The accessibility of 'j' has already been specified as PRIVATE [-Wredundant-attribute] private j end @@ -66,7 +66,7 @@ subroutine s4 !ERROR: 'fun' is PRIVATE in 'm4' use m4, only: foo, fun type(foo) x ! ok - !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'fun') is ambiguous with a structure constructor of the same name + !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'fun') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor] print *, foo() end diff --git a/flang/test/Semantics/resolve114.f90 b/flang/test/Semantics/resolve114.f90 index 6204e5fc2f3f4..05fb7aa5e4795 100644 --- a/flang/test/Semantics/resolve114.f90 +++ b/flang/test/Semantics/resolve114.f90 @@ -34,9 +34,9 @@ end module m2 subroutine s2a use m1 use m2 - !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(sin), pointer :: p1 => sin - !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(iabs), pointer :: p2 => iabs procedure(ext1), pointer :: p3 => ext1 procedure(ext2), pointer :: p4 => ext2 @@ -46,9 +46,9 @@ subroutine s2b use m1, only: x1 => sin, x2 => iabs, x3 => ext1, x4 => ext2 use m2, only: x1 => sin, x2 => iabs, x3 => ext1, x4 => ext2 use m1, only: iface1 => sin, iface2 => iabs, iface3 => ext1, iface4 => ext2 - !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(iface1), pointer :: p1 => x1 - !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(iface2), pointer :: p2 => x2 procedure(iface3), pointer :: p3 => x3 procedure(iface4), pointer :: p4 => x4 @@ -60,9 +60,9 @@ module m3 end module subroutine s3 use m3 - !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(sin), pointer :: p1 => sin - !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(iabs), pointer :: p2 => iabs procedure(ext1), pointer :: p3 => ext1 procedure(ext2), pointer :: p4 => ext2 @@ -75,9 +75,9 @@ module m4 subroutine s4 use m4 use m1, only: iface1 => sin, iface2 => iabs, iface3 => ext1, iface4 => ext2 - !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(iface1), pointer :: p1 => x1 - !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(iface2), pointer :: p2 => x2 procedure(iface3), pointer :: p3 => x3 procedure(iface4), pointer :: p4 => x4 @@ -87,10 +87,10 @@ subroutine s5 use m1, only: x1 => sin, x2 => iabs, x3 => ext1, x4 => ext2 use m2, only: x1 => tan, x2 => idim, x3 => ext2, x4 => ext1 use m1, only: iface1 => sin, iface2 => iabs, iface3 => ext1, iface4 => ext2 - !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface [-Wportability] !ERROR: Reference to 'x1' is ambiguous procedure(iface1), pointer :: p1 => x1 - !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface [-Wportability] !ERROR: Reference to 'x2' is ambiguous procedure(iface2), pointer :: p2 => x2 !ERROR: Reference to 'x3' is ambiguous diff --git a/flang/test/Semantics/resolve118.f90 b/flang/test/Semantics/resolve118.f90 index 024b67b5a471b..59199dfd6311b 100644 --- a/flang/test/Semantics/resolve118.f90 +++ b/flang/test/Semantics/resolve118.f90 @@ -17,7 +17,7 @@ module m3 interface subroutine s1(x) use m1 - !PORTABILITY: The same 't' is already present in this scope + !PORTABILITY: The same 't' is already present in this scope [-Wbenign-name-clash] import t type(t) x end diff --git a/flang/test/Semantics/resolve17.f90 b/flang/test/Semantics/resolve17.f90 index 6a6e355abe0b8..173fb9c6c5b78 100644 --- a/flang/test/Semantics/resolve17.f90 +++ b/flang/test/Semantics/resolve17.f90 @@ -11,7 +11,7 @@ module m2 interface s end interface contains - !WARNING: 's' should not be the name of both a generic interface and a procedure unless it is a specific procedure of the generic + !WARNING: 's' should not be the name of both a generic interface and a procedure unless it is a specific procedure of the generic [-Whomonymous-specific] subroutine s end subroutine end module @@ -290,7 +290,7 @@ module m14d contains subroutine test real :: y - !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'bar') is ambiguous with a structure constructor of the same name + !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'bar') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor] y = foo(1.0) x = foo(2) end subroutine @@ -302,7 +302,7 @@ module m14e contains subroutine test real :: y - !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'bar') is ambiguous with a structure constructor of the same name + !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'bar') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor] y = foo(1.0) x = foo(2) end subroutine diff --git a/flang/test/Semantics/resolve18.f90 b/flang/test/Semantics/resolve18.f90 index 547db5e85714c..65c39931cc7cb 100644 --- a/flang/test/Semantics/resolve18.f90 +++ b/flang/test/Semantics/resolve18.f90 @@ -11,7 +11,7 @@ subroutine foo(x) module m2 use m1 implicit none - !WARNING: 'foo' should not be the name of both a generic interface and a procedure unless it is a specific procedure of the generic + !WARNING: 'foo' should not be the name of both a generic interface and a procedure unless it is a specific procedure of the generic [-Whomonymous-specific] interface foo module procedure s end interface @@ -22,14 +22,14 @@ subroutine s(i) end module subroutine foo - !PORTABILITY: 'foo' is use-associated into a subprogram of the same name + !PORTABILITY: 'foo' is use-associated into a subprogram of the same name [-Wuse-association-into-same-name-subprogram] use m1 !ERROR: Reference to 'foo' is ambiguous call foo end subroutine bar - !PORTABILITY: 'foo' is use-associated into a subprogram of the same name + !PORTABILITY: 'foo' is use-associated into a subprogram of the same name [-Wuse-association-into-same-name-subprogram] use m1, bar => foo !ERROR: Reference to 'bar' is ambiguous call bar @@ -348,7 +348,7 @@ subroutine s_21_23 use m21 use m23 type(foo) x ! Intel and NAG error - !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'f1') is ambiguous with a structure constructor of the same name + !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'f1') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor] print *, foo(1.) ! Intel error print *, foo(1.,2.,3.) ! Intel error call ext(foo) ! GNU and Intel error diff --git a/flang/test/Semantics/resolve20.f90 b/flang/test/Semantics/resolve20.f90 index 359bc0c1f9a3f..8b8d190206689 100644 --- a/flang/test/Semantics/resolve20.f90 +++ b/flang/test/Semantics/resolve20.f90 @@ -38,7 +38,7 @@ subroutine forward type :: bad3 end type - !PORTABILITY: Name 'm' declared in a module should not have the same name as the module + !PORTABILITY: Name 'm' declared in a module should not have the same name as the module [-Wbenign-name-clash] type :: m end type m @@ -49,7 +49,7 @@ subroutine forward external :: a, b, c, d !ERROR: EXTERNAL attribute not allowed on 'm' external :: m - !WARNING: EXTERNAL attribute was already specified on 'foo' + !WARNING: EXTERNAL attribute was already specified on 'foo' [-Wredundant-attribute] external :: foo !ERROR: EXTERNAL attribute not allowed on 'bar' external :: bar diff --git a/flang/test/Semantics/resolve24.f90 b/flang/test/Semantics/resolve24.f90 index 72d6719665bb5..664fe0faeedc9 100644 --- a/flang/test/Semantics/resolve24.f90 +++ b/flang/test/Semantics/resolve24.f90 @@ -1,6 +1,6 @@ ! RUN: %python %S/test_errors.py %s %flang_fc1 subroutine test1 - !WARNING: Generic interface 'foo' has both a function and a subroutine + !WARNING: Generic interface 'foo' has both a function and a subroutine [-Wsubroutine-and-function-specifics] interface foo subroutine s1(x) end subroutine @@ -12,7 +12,7 @@ function f() end subroutine subroutine test2 - !WARNING: Generic interface 'foo' has both a function and a subroutine + !WARNING: Generic interface 'foo' has both a function and a subroutine [-Wsubroutine-and-function-specifics] interface foo function t2f1(x) end function @@ -24,7 +24,7 @@ function t2f2(x, y) end subroutine module test3 - !WARNING: Generic interface 'foo' has both a function and a subroutine + !WARNING: Generic interface 'foo' has both a function and a subroutine [-Wsubroutine-and-function-specifics] interface foo module procedure s module procedure f @@ -39,7 +39,7 @@ function f() subroutine test4 type foo end type - !WARNING: Generic interface 'foo' should only contain functions due to derived type with same name + !WARNING: Generic interface 'foo' should only contain functions due to derived type with same name [-Wsubroutine-and-function-specifics] interface foo subroutine s() end subroutine diff --git a/flang/test/Semantics/resolve30.f90 b/flang/test/Semantics/resolve30.f90 index 32108e89cdefe..28613dfe4ffd9 100644 --- a/flang/test/Semantics/resolve30.f90 +++ b/flang/test/Semantics/resolve30.f90 @@ -41,6 +41,6 @@ subroutine s4 subroutine s5 implicit none data x/1./ - !PORTABILITY: 'x' appeared in a DATA statement before its type was declared under IMPLICIT NONE(TYPE) + !PORTABILITY: 'x' appeared in a DATA statement before its type was declared under IMPLICIT NONE(TYPE) [-Wforward-ref-implicit-none-data] real x end diff --git a/flang/test/Semantics/resolve31.f90 b/flang/test/Semantics/resolve31.f90 index 6bf8e877a5156..eabd87776904d 100644 --- a/flang/test/Semantics/resolve31.f90 +++ b/flang/test/Semantics/resolve31.f90 @@ -49,9 +49,9 @@ module m4 type :: t1 private sequence - !WARNING: PRIVATE should not appear more than once in derived type components + !WARNING: PRIVATE should not appear more than once in derived type components [-Wredundant-attribute] private - !WARNING: SEQUENCE should not appear more than once in derived type components + !WARNING: SEQUENCE should not appear more than once in derived type components [-Wredundant-attribute] sequence real :: t1Field end type @@ -68,7 +68,7 @@ module m4 !ERROR: A sequence type may not have a CONTAINS statement contains end type - !WARNING: A sequence type should have at least one component + !WARNING: A sequence type should have at least one component [-Wempty-sequence-type] type :: emptyType sequence end type emptyType @@ -85,7 +85,7 @@ module m4 class(*), allocatable :: typeStarField !ERROR: A sequence type data component must either be of an intrinsic type or a derived sequence type type(plainType) :: testField1 - !WARNING: A sequence type data component that is a pointer to a non-sequence type is not standard + !WARNING: A sequence type data component that is a pointer to a non-sequence type is not standard [-Wpointer-in-seq-type] type(plainType), pointer :: testField1p type(sequenceType) :: testField2 procedure(real), pointer, nopass :: procField diff --git a/flang/test/Semantics/resolve35.f90 b/flang/test/Semantics/resolve35.f90 index 2947b225978d1..f3f8409161df2 100644 --- a/flang/test/Semantics/resolve35.f90 +++ b/flang/test/Semantics/resolve35.f90 @@ -21,14 +21,14 @@ subroutine s3 real :: a(10,10), b(10,10) type y; end type integer(8) :: x - !PORTABILITY: Index variable 'y' should be a scalar object or common block if it is present in the enclosing scope + !PORTABILITY: Index variable 'y' should be a scalar object or common block if it is present in the enclosing scope [-Wodd-index-variable-restrictions] !ERROR: Must have INTEGER type, but is REAL(4) forall(x=1:10, y=1:10) !ERROR: Must have INTEGER type, but is REAL(4) !ERROR: Must have INTEGER type, but is REAL(4) a(x, y) = b(x, y) end forall - !PORTABILITY: Index variable 'y' should be a scalar object or common block if it is present in the enclosing scope + !PORTABILITY: Index variable 'y' should be a scalar object or common block if it is present in the enclosing scope [-Wodd-index-variable-restrictions] !ERROR: Must have INTEGER type, but is REAL(4) !ERROR: Must have INTEGER type, but is REAL(4) !ERROR: Must have INTEGER type, but is REAL(4) @@ -51,7 +51,7 @@ subroutine s4 !ERROR: Must have INTEGER type, but is REAL(4) a(y) = b(y) end forall - !PORTABILITY: Index variable 'i' should be scalar in the enclosing scope + !PORTABILITY: Index variable 'i' should be scalar in the enclosing scope [-Wodd-index-variable-restrictions] forall(i=1:10) a(i) = b(i) end forall @@ -61,7 +61,7 @@ subroutine s6 integer, parameter :: n = 4 real, dimension(n) :: x data(x(i), i=1, n) / n * 0.0 / - !PORTABILITY: Index variable 't' should be a scalar object or common block if it is present in the enclosing scope + !PORTABILITY: Index variable 't' should be a scalar object or common block if it is present in the enclosing scope [-Wodd-index-variable-restrictions] !ERROR: Must have INTEGER type, but is REAL(4) !ERROR: Must have INTEGER type, but is REAL(4) forall(t=1:n) x(t) = 0.0 @@ -86,7 +86,7 @@ subroutine s7 do concurrent(integer::i=1:5) local(j, i) & !ERROR: 'j' is already declared in this scoping unit local_init(k, j) & - !WARNING: Variable 'a' with SHARED locality implicitly declared + !WARNING: Variable 'a' with SHARED locality implicitly declared [-Wimplicit-shared] shared(a) a = j + 1 end do diff --git a/flang/test/Semantics/resolve37.f90 b/flang/test/Semantics/resolve37.f90 index f8229f1f974a4..d35174e62d64a 100644 --- a/flang/test/Semantics/resolve37.f90 +++ b/flang/test/Semantics/resolve37.f90 @@ -25,25 +25,25 @@ character(len=l) :: v !ERROR: Value of named constant 'o' (o) cannot be computed as a constant value real, parameter :: o = o -!WARNING: INTEGER(4) division by zero +!WARNING: INTEGER(4) division by zero [-Wfolding-exception] !ERROR: Must be a constant value integer, parameter :: p = 0/0 -!WARNING: INTEGER(4) division by zero +!WARNING: INTEGER(4) division by zero [-Wfolding-exception] !ERROR: Must be a constant value -!WARNING: INTEGER(4) division by zero -!WARNING: INTEGER(4) division by zero -!WARNING: INTEGER(4) division by zero +!WARNING: INTEGER(4) division by zero [-Wfolding-exception] +!WARNING: INTEGER(4) division by zero [-Wfolding-exception] +!WARNING: INTEGER(4) division by zero [-Wfolding-exception] integer, parameter :: q = 1+2*(1/0) integer not_constant !ERROR: Must be a constant value integer, parameter :: s1 = not_constant/2 !ERROR: Must be a constant value integer, parameter :: s2 = 3/not_constant -!WARNING: INTEGER(4) division by zero +!WARNING: INTEGER(4) division by zero [-Wfolding-exception] !ERROR: Must be a constant value integer(kind=2/0) r integer, parameter :: sok(*)=[1,2]/[1,2] -!WARNING: INTEGER(4) division by zero +!WARNING: INTEGER(4) division by zero [-Wfolding-exception] !ERROR: Must be a constant value integer, parameter :: snok(*)=[1,2]/[1,0] end diff --git a/flang/test/Semantics/resolve45.f90 b/flang/test/Semantics/resolve45.f90 index 7f6d8d6ae50b2..18a382a788b6b 100644 --- a/flang/test/Semantics/resolve45.f90 +++ b/flang/test/Semantics/resolve45.f90 @@ -36,13 +36,13 @@ subroutine s3(x) end subroutine s4 - !WARNING: Explicit SAVE of 'z' is redundant due to global SAVE statement + !WARNING: Explicit SAVE of 'z' is redundant due to global SAVE statement [-Wredundant-attribute] save z save procedure(integer), pointer :: x - !WARNING: Explicit SAVE of 'x' is redundant due to global SAVE statement + !WARNING: Explicit SAVE of 'x' is redundant due to global SAVE statement [-Wredundant-attribute] save :: x - !WARNING: Explicit SAVE of 'y' is redundant due to global SAVE statement + !WARNING: Explicit SAVE of 'y' is redundant due to global SAVE statement [-Wredundant-attribute] integer, save :: y end diff --git a/flang/test/Semantics/resolve46.f90 b/flang/test/Semantics/resolve46.f90 index 0acc20b19f0b7..d473226edaabe 100644 --- a/flang/test/Semantics/resolve46.f90 +++ b/flang/test/Semantics/resolve46.f90 @@ -20,7 +20,7 @@ logical function chrcmp(a,b) end function chrcmp end interface - !PORTABILITY: Procedure pointer 'p' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'p' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(sin), pointer :: p => cos !ERROR: Intrinsic procedure 'amin0' is not an unrestricted specific intrinsic permitted for use as the definition of the interface to procedure pointer 'q' procedure(amin0), pointer :: q @@ -29,7 +29,7 @@ end function chrcmp !ERROR: Intrinsic procedure 'llt' is not an unrestricted specific intrinsic permitted for use as the initializer for procedure pointer 's' procedure(chrcmp), pointer :: s => llt !ERROR: Intrinsic procedure 'bessel_j0' is not an unrestricted specific intrinsic permitted for use as the initializer for procedure pointer 't' - !PORTABILITY: Procedure pointer 't' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 't' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(cos), pointer :: t => bessel_j0 procedure(chrcmp), pointer :: u p => alog ! valid use of an unrestricted specific intrinsic diff --git a/flang/test/Semantics/resolve58.f90 b/flang/test/Semantics/resolve58.f90 index 7686de4898404..ff9d6c358c69e 100644 --- a/flang/test/Semantics/resolve58.f90 +++ b/flang/test/Semantics/resolve58.f90 @@ -69,12 +69,12 @@ subroutine s6() !ERROR: Implied-shape array 'local1' must be a named constant or a dummy argument real, dimension (*) :: local1 - !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute + !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute [-Wignore-irrelevant-attributes] real, intent(in) :: local2 - !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute + !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute [-Wignore-irrelevant-attributes] procedure(), intent(in) :: p1 - !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute + !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute [-Wignore-irrelevant-attributes] real, optional :: local3 - !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute + !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute [-Wignore-irrelevant-attributes] procedure(), optional :: p2 end subroutine diff --git a/flang/test/Semantics/resolve59.f90 b/flang/test/Semantics/resolve59.f90 index 3bdcf67aa958a..a598fbe1849f3 100644 --- a/flang/test/Semantics/resolve59.f90 +++ b/flang/test/Semantics/resolve59.f90 @@ -59,10 +59,10 @@ real function rfunc(x) x = acos(f5) end function ! Sanity test: f18 handles C1560 violation by ignoring RESULT - !WARNING: The function name should not appear in RESULT; references to 'f6' inside the function will be considered as references to the result only + !WARNING: The function name should not appear in RESULT; references to 'f6' inside the function will be considered as references to the result only [-Whomonymous-result] function f6() result(f6) end function - !WARNING: The function name should not appear in RESULT; references to 'f7' inside the function will be considered as references to the result only + !WARNING: The function name should not appear in RESULT; references to 'f7' inside the function will be considered as references to the result only [-Whomonymous-result] function f7() result(f7) real :: x, f7 !ERROR: Recursive call to 'f7' requires a distinct RESULT in its declaration @@ -114,7 +114,7 @@ function f4() result(r) end function function f5(x) result(r) real :: x - !PORTABILITY: Procedure pointer 'r' should not have an ELEMENTAL intrinsic as its interface + !PORTABILITY: Procedure pointer 'r' should not have an ELEMENTAL intrinsic as its interface [-Wportability] procedure(acos), pointer :: r r => acos !ERROR: Actual argument for 'x=' may not be a procedure diff --git a/flang/test/Semantics/resolve60.f90 b/flang/test/Semantics/resolve60.f90 index ff988d54a8210..0192f830dad63 100644 --- a/flang/test/Semantics/resolve60.f90 +++ b/flang/test/Semantics/resolve60.f90 @@ -32,7 +32,7 @@ enum, bind(C) !ERROR: Enumerator value could not be computed from the given expression - !WARNING: INTEGER(4) division by zero + !WARNING: INTEGER(4) division by zero [-Wfolding-exception] !ERROR: Must be a constant value enumerator :: wrong = 0/0 end enum diff --git a/flang/test/Semantics/resolve61.f90 b/flang/test/Semantics/resolve61.f90 index 2a1f584ffaf08..ffee32243af6e 100644 --- a/flang/test/Semantics/resolve61.f90 +++ b/flang/test/Semantics/resolve61.f90 @@ -114,7 +114,7 @@ subroutine p12 type(t2) :: x2 type(t3) :: x3 pointer(a, x1) - !WARNING: Type of Cray pointee 'x2' is a derived type that is neither SEQUENCE nor BIND(C) + !WARNING: Type of Cray pointee 'x2' is a derived type that is neither SEQUENCE nor BIND(C) [-Wnon-sequence-cray-pointee] pointer(b, x2) pointer(c, x3) end diff --git a/flang/test/Semantics/resolve65.f90 b/flang/test/Semantics/resolve65.f90 index b2815c4ed1c79..1f985125a152c 100644 --- a/flang/test/Semantics/resolve65.f90 +++ b/flang/test/Semantics/resolve65.f90 @@ -15,8 +15,8 @@ module m1 procedure :: assign_t2 procedure :: assign_t3 !ERROR: Defined assignment subroutine 'assign_t2' must have two dummy arguments - !WARNING: In defined assignment subroutine 'assign_t3', second dummy argument 'y' should have INTENT(IN) or VALUE attribute - !WARNING: In defined assignment subroutine 'assign_t4', first dummy argument 'x' should have INTENT(OUT) or INTENT(INOUT) + !WARNING: In defined assignment subroutine 'assign_t3', second dummy argument 'y' should have INTENT(IN) or VALUE attribute [-Wdefined-operator-args] + !WARNING: In defined assignment subroutine 'assign_t4', first dummy argument 'x' should have INTENT(OUT) or INTENT(INOUT) [-Wdefined-operator-args] !ERROR: In defined assignment subroutine 'assign_t5', first dummy argument 'x' may not have INTENT(IN) !ERROR: In defined assignment subroutine 'assign_t6', second dummy argument 'y' may not have INTENT(OUT) generic :: assignment(=) => assign_t, assign_t2, assign_t3, assign_t4, assign_t5, assign_t6 diff --git a/flang/test/Semantics/resolve67.f90 b/flang/test/Semantics/resolve67.f90 index 677eef21d0a8f..7dd0f2adc9d7b 100644 --- a/flang/test/Semantics/resolve67.f90 +++ b/flang/test/Semantics/resolve67.f90 @@ -41,7 +41,7 @@ character(*) function divide(x, y) end end interface interface operator(<) - !WARNING: In OPERATOR(<) function 'lt1', dummy argument 'x' should have INTENT(IN) or VALUE attribute + !WARNING: In OPERATOR(<) function 'lt1', dummy argument 'x' should have INTENT(IN) or VALUE attribute [-Wdefined-operator-args] !ERROR: In OPERATOR(<) function 'lt1', dummy argument 'y' may not be OPTIONAL logical function lt1(x, y) logical :: x @@ -90,7 +90,7 @@ real function plus(x) end end interface interface operator(.not.) - !WARNING: The external interface 'not1' is not compatible with an earlier definition (distinct numbers of dummy arguments) + !WARNING: The external interface 'not1' is not compatible with an earlier definition (distinct numbers of dummy arguments) [-Wexternal-interface-mismatch] real function not1(x) real, value :: x end diff --git a/flang/test/Semantics/resolve69.f90 b/flang/test/Semantics/resolve69.f90 index 5acfd30604fe3..5af14b48a07eb 100644 --- a/flang/test/Semantics/resolve69.f90 +++ b/flang/test/Semantics/resolve69.f90 @@ -16,7 +16,7 @@ subroutine s1() ! integer, parameter :: constVal = 1 integer :: nonConstVal = 1 -!PORTABILITY: specification expression refers to local object 'nonconstval' (initialized and saved) +!PORTABILITY: specification expression refers to local object 'nonconstval' (initialized and saved) [-Wsaved-local-in-spec-expr] character(nonConstVal) :: colonString1 character(len=20, kind=constVal + 1) :: constKindString character(len=:, kind=constVal + 1), pointer :: constKindString1 @@ -53,13 +53,13 @@ function foo3() type (derived(constVal, 3)) :: constDerivedKind !ERROR: Value of KIND type parameter 'typekind' must be constant -!PORTABILITY: specification expression refers to local object 'nonconstval' (initialized and saved) +!PORTABILITY: specification expression refers to local object 'nonconstval' (initialized and saved) [-Wsaved-local-in-spec-expr] type (derived(nonConstVal, 3)) :: nonConstDerivedKind !OK because all type-params are constants type (derived(3, constVal)) :: constDerivedLen -!PORTABILITY: specification expression refers to local object 'nonconstval' (initialized and saved) +!PORTABILITY: specification expression refers to local object 'nonconstval' (initialized and saved) [-Wsaved-local-in-spec-expr] type (derived(3, nonConstVal)) :: nonConstDerivedLen !ERROR: 'colonderivedlen' has a type derived(typekind=3_4,typelen=:) with a deferred type parameter but is neither an allocatable nor an object pointer type (derived(3, :)) :: colonDerivedLen diff --git a/flang/test/Semantics/resolve77.f90 b/flang/test/Semantics/resolve77.f90 index 0133fac3bfbc5..f58f2637c453e 100644 --- a/flang/test/Semantics/resolve77.f90 +++ b/flang/test/Semantics/resolve77.f90 @@ -60,13 +60,13 @@ pure integer function if2(n) block data common /blk2/ n data n/100/ - !PORTABILITY: specification expression refers to local object 'n' (initialized and saved) + !PORTABILITY: specification expression refers to local object 'n' (initialized and saved) [-Wsaved-local-in-spec-expr] !ERROR: Automatic data object 'a' may not appear in a BLOCK DATA subprogram real a(n) end program main common /blk2/ n - !PORTABILITY: Automatic data object 'a' should not appear in the specification part of a main program + !PORTABILITY: Automatic data object 'a' should not appear in the specification part of a main program [-Wautomatic-in-main-program] real a(n) end diff --git a/flang/test/Semantics/resolve78.f90 b/flang/test/Semantics/resolve78.f90 index 8c25f32e80cdc..c4163fe370310 100644 --- a/flang/test/Semantics/resolve78.f90 +++ b/flang/test/Semantics/resolve78.f90 @@ -11,21 +11,21 @@ module m ! POINTER type :: derived - !WARNING: Attribute 'PUBLIC' cannot be used more than once + !WARNING: Attribute 'PUBLIC' cannot be used more than once [-Wredundant-attribute] real, public, allocatable, public :: field1 - !WARNING: Attribute 'PRIVATE' cannot be used more than once + !WARNING: Attribute 'PRIVATE' cannot be used more than once [-Wredundant-attribute] real, private, allocatable, private :: field2 !ERROR: Attributes 'PUBLIC' and 'PRIVATE' conflict with each other real, public, allocatable, private :: field3 - !WARNING: Attribute 'ALLOCATABLE' cannot be used more than once + !WARNING: Attribute 'ALLOCATABLE' cannot be used more than once [-Wredundant-attribute] real, allocatable, public, allocatable :: field4 !ERROR: Attribute 'CODIMENSION' cannot be used more than once real, public, codimension[:], allocatable, codimension[:] :: field5 - !WARNING: Attribute 'CONTIGUOUS' cannot be used more than once + !WARNING: Attribute 'CONTIGUOUS' cannot be used more than once [-Wredundant-attribute] real, public, contiguous, pointer, contiguous, dimension(:) :: field6 !ERROR: Attribute 'DIMENSION' cannot be used more than once real, dimension(5), public, dimension(5) :: field7 - !WARNING: Attribute 'POINTER' cannot be used more than once + !WARNING: Attribute 'POINTER' cannot be used more than once [-Wredundant-attribute] real, pointer, public, pointer :: field8 end type derived diff --git a/flang/test/Semantics/resolve79.f90 b/flang/test/Semantics/resolve79.f90 index 037e107dc5874..87bd55a3bcfb5 100644 --- a/flang/test/Semantics/resolve79.f90 +++ b/flang/test/Semantics/resolve79.f90 @@ -12,17 +12,17 @@ module m ! PUBLIC, PRIVATE, NOPASS, PASS, POINTER type :: procComponentType - !WARNING: Attribute 'PUBLIC' cannot be used more than once + !WARNING: Attribute 'PUBLIC' cannot be used more than once [-Wredundant-attribute] procedure(publicProc), public, pointer, public :: publicField - !WARNING: Attribute 'PRIVATE' cannot be used more than once + !WARNING: Attribute 'PRIVATE' cannot be used more than once [-Wredundant-attribute] procedure(privateProc), private, pointer, private :: privateField - !WARNING: Attribute 'NOPASS' cannot be used more than once + !WARNING: Attribute 'NOPASS' cannot be used more than once [-Wredundant-attribute] procedure(nopassProc), nopass, pointer, nopass :: noPassField - !WARNING: Attribute 'PASS' cannot be used more than once + !WARNING: Attribute 'PASS' cannot be used more than once [-Wredundant-attribute] procedure(passProc), pass, pointer, pass :: passField !ERROR: Attributes 'PASS' and 'NOPASS' conflict with each other procedure(passNopassProc), pass, pointer, nopass :: passNopassField - !WARNING: Attribute 'POINTER' cannot be used more than once + !WARNING: Attribute 'POINTER' cannot be used more than once [-Wredundant-attribute] procedure(pointerProc), pointer, public, pointer :: pointerField !ERROR: Procedure component 'nonpointerfield' must have POINTER attribute procedure(publicProc), public :: nonpointerField diff --git a/flang/test/Semantics/resolve80.f90 b/flang/test/Semantics/resolve80.f90 index e787a4ba7f866..7df6a6c57d695 100644 --- a/flang/test/Semantics/resolve80.f90 +++ b/flang/test/Semantics/resolve80.f90 @@ -13,17 +13,17 @@ module m ! type, abstract :: boundProcType contains - !WARNING: Attribute 'PUBLIC' cannot be used more than once + !WARNING: Attribute 'PUBLIC' cannot be used more than once [-Wredundant-attribute] procedure(subPublic), public, deferred, public :: publicBinding - !WARNING: Attribute 'PRIVATE' cannot be used more than once + !WARNING: Attribute 'PRIVATE' cannot be used more than once [-Wredundant-attribute] procedure(subPrivate), private, deferred, private :: privateBinding - !WARNING: Attribute 'DEFERRED' cannot be used more than once + !WARNING: Attribute 'DEFERRED' cannot be used more than once [-Wredundant-attribute] procedure(subDeferred), deferred, public, deferred :: deferredBinding - !WARNING: Attribute 'NON_OVERRIDABLE' cannot be used more than once + !WARNING: Attribute 'NON_OVERRIDABLE' cannot be used more than once [-Wredundant-attribute] procedure, non_overridable, public, non_overridable :: subNon_overridable; - !WARNING: Attribute 'NOPASS' cannot be used more than once + !WARNING: Attribute 'NOPASS' cannot be used more than once [-Wredundant-attribute] procedure(subNopass), nopass, deferred, nopass :: nopassBinding - !WARNING: Attribute 'PASS' cannot be used more than once + !WARNING: Attribute 'PASS' cannot be used more than once [-Wredundant-attribute] procedure(subPass), pass, deferred, pass :: passBinding !ERROR: Attributes 'PASS' and 'NOPASS' conflict with each other procedure(subPassNopass), pass, deferred, nopass :: passNopassBinding ! C781 diff --git a/flang/test/Semantics/resolve81.f90 b/flang/test/Semantics/resolve81.f90 index db5b19f1155ea..23651cbb257e7 100644 --- a/flang/test/Semantics/resolve81.f90 +++ b/flang/test/Semantics/resolve81.f90 @@ -11,52 +11,52 @@ ! VOLATILE module m - !WARNING: Attribute 'PUBLIC' cannot be used more than once + !WARNING: Attribute 'PUBLIC' cannot be used more than once [-Wredundant-attribute] real, public, allocatable, public :: publicVar - !WARNING: Attribute 'PRIVATE' cannot be used more than once + !WARNING: Attribute 'PRIVATE' cannot be used more than once [-Wredundant-attribute] real, private, allocatable, private :: privateVar - !WARNING: Attribute 'ALLOCATABLE' cannot be used more than once + !WARNING: Attribute 'ALLOCATABLE' cannot be used more than once [-Wredundant-attribute] real, allocatable, allocatable :: allocVar - !WARNING: Attribute 'ASYNCHRONOUS' cannot be used more than once + !WARNING: Attribute 'ASYNCHRONOUS' cannot be used more than once [-Wredundant-attribute] real, asynchronous, public, asynchronous :: asynchVar !ERROR: Attribute 'CODIMENSION' cannot be used more than once real, codimension[*], codimension[*] :: codimensionVar - !WARNING: Attribute 'CONTIGUOUS' cannot be used more than once + !WARNING: Attribute 'CONTIGUOUS' cannot be used more than once [-Wredundant-attribute] real, contiguous, pointer, contiguous :: contigVar(:) !ERROR: Attribute 'DIMENSION' cannot be used more than once real, dimension(5), dimension(5) :: arrayVar - !WARNING: Attribute 'EXTERNAL' cannot be used more than once + !WARNING: Attribute 'EXTERNAL' cannot be used more than once [-Wredundant-attribute] real, external, external :: externFunc - !WARNING: Attribute 'INTRINSIC' cannot be used more than once + !WARNING: Attribute 'INTRINSIC' cannot be used more than once [-Wredundant-attribute] !ERROR: 'cos' may not have both the BIND(C) and INTRINSIC attributes !ERROR: An interface name with the BIND attribute must appear if the BIND attribute appears in a procedure declaration real, intrinsic, bind(c), intrinsic :: cos - !WARNING: Attribute 'BIND(C)' cannot be used more than once + !WARNING: Attribute 'BIND(C)' cannot be used more than once [-Wredundant-attribute] integer, bind(c), volatile, bind(c) :: bindVar - !WARNING: Attribute 'PARAMETER' cannot be used more than once + !WARNING: Attribute 'PARAMETER' cannot be used more than once [-Wredundant-attribute] real, parameter, parameter :: realConst = 4.3 - !WARNING: Attribute 'POINTER' cannot be used more than once + !WARNING: Attribute 'POINTER' cannot be used more than once [-Wredundant-attribute] real, pointer, pointer :: realPtr - !WARNING: Attribute 'PROTECTED' cannot be used more than once + !WARNING: Attribute 'PROTECTED' cannot be used more than once [-Wredundant-attribute] real, protected, protected :: realProt - !WARNING: Attribute 'SAVE' cannot be used more than once + !WARNING: Attribute 'SAVE' cannot be used more than once [-Wredundant-attribute] real, save, save :: saveVar - !WARNING: Attribute 'TARGET' cannot be used more than once + !WARNING: Attribute 'TARGET' cannot be used more than once [-Wredundant-attribute] real, target, target :: targetVar - !WARNING: Attribute 'VOLATILE' cannot be used more than once + !WARNING: Attribute 'VOLATILE' cannot be used more than once [-Wredundant-attribute] real, volatile, volatile :: volatileVar contains subroutine testTypeDecl(arg1, arg2, arg3, arg4, arg5, arg6) - !WARNING: Attribute 'INTENT(IN)' cannot be used more than once + !WARNING: Attribute 'INTENT(IN)' cannot be used more than once [-Wredundant-attribute] real, intent(in), intent(in) :: arg1 - !WARNING: Attribute 'INTENT(OUT)' cannot be used more than once + !WARNING: Attribute 'INTENT(OUT)' cannot be used more than once [-Wredundant-attribute] real, intent(out), intent(out) :: arg2 - !WARNING: Attribute 'INTENT(INOUT)' cannot be used more than once + !WARNING: Attribute 'INTENT(INOUT)' cannot be used more than once [-Wredundant-attribute] real, intent(inout), intent(inout) :: arg3 - !WARNING: Attribute 'OPTIONAL' cannot be used more than once + !WARNING: Attribute 'OPTIONAL' cannot be used more than once [-Wredundant-attribute] integer, optional, intent(in), optional :: arg4 - !WARNING: Attribute 'VALUE' cannot be used more than once + !WARNING: Attribute 'VALUE' cannot be used more than once [-Wredundant-attribute] integer, value, intent(in), value :: arg5 !ERROR: Attributes 'INTENT(IN)' and 'INTENT(INOUT)' conflict with each other integer, intent(in), pointer, intent(inout) :: arg6 diff --git a/flang/test/Semantics/resolve82.f90 b/flang/test/Semantics/resolve82.f90 index 989ce1d837c70..c06edd6bb5d98 100644 --- a/flang/test/Semantics/resolve82.f90 +++ b/flang/test/Semantics/resolve82.f90 @@ -14,14 +14,14 @@ real function procFunc() end function procFunc end interface - !WARNING: Attribute 'PUBLIC' cannot be used more than once + !WARNING: Attribute 'PUBLIC' cannot be used more than once [-Wredundant-attribute] procedure(procFunc), public, pointer, public :: proc1 - !WARNING: Attribute 'PRIVATE' cannot be used more than once + !WARNING: Attribute 'PRIVATE' cannot be used more than once [-Wredundant-attribute] procedure(procFunc), private, pointer, private :: proc2 - !WARNING: Attribute 'BIND(C)' cannot be used more than once + !WARNING: Attribute 'BIND(C)' cannot be used more than once [-Wredundant-attribute] !ERROR: An interface name with the BIND attribute must appear if the BIND attribute appears in a procedure declaration procedure(procFunc), bind(c), pointer, bind(c) :: proc3 - !WARNING: Attribute 'PROTECTED' cannot be used more than once + !WARNING: Attribute 'PROTECTED' cannot be used more than once [-Wredundant-attribute] procedure(procFunc), protected, pointer, protected :: proc4 !ERROR: A PROTECTED entity must be a variable or pointer external extsub @@ -39,21 +39,21 @@ end function procFunc contains subroutine testProcDecl(arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) - !WARNING: Attribute 'INTENT(IN)' cannot be used more than once + !WARNING: Attribute 'INTENT(IN)' cannot be used more than once [-Wredundant-attribute] procedure(procFunc), intent(in), pointer, intent(in) :: arg4 - !WARNING: Attribute 'INTENT(OUT)' cannot be used more than once + !WARNING: Attribute 'INTENT(OUT)' cannot be used more than once [-Wredundant-attribute] procedure(procFunc), intent(out), pointer, intent(out) :: arg5 - !WARNING: Attribute 'INTENT(INOUT)' cannot be used more than once + !WARNING: Attribute 'INTENT(INOUT)' cannot be used more than once [-Wredundant-attribute] procedure(procFunc), intent(inout), pointer, intent(inout) :: arg6 !ERROR: Attributes 'INTENT(INOUT)' and 'INTENT(OUT)' conflict with each other procedure(procFunc), intent(inout), pointer, intent(out) :: arg7 !ERROR: Attributes 'INTENT(INOUT)' and 'INTENT(OUT)' conflict with each other procedure(procFunc), intent(out), pointer, intent(inout) :: arg8 - !WARNING: Attribute 'OPTIONAL' cannot be used more than once + !WARNING: Attribute 'OPTIONAL' cannot be used more than once [-Wredundant-attribute] procedure(procFunc), optional, pointer, optional :: arg9 - !WARNING: Attribute 'POINTER' cannot be used more than once + !WARNING: Attribute 'POINTER' cannot be used more than once [-Wredundant-attribute] procedure(procFunc), pointer, optional, pointer :: arg10 - !WARNING: Attribute 'SAVE' cannot be used more than once + !WARNING: Attribute 'SAVE' cannot be used more than once [-Wredundant-attribute] procedure(procFunc), save, pointer, save :: localProc !ERROR: A PROTECTED entity must be in the specification part of a module real x diff --git a/flang/test/Semantics/resolve83.f90 b/flang/test/Semantics/resolve83.f90 index e9d53dd6bd81d..a60a9980293f9 100644 --- a/flang/test/Semantics/resolve83.f90 +++ b/flang/test/Semantics/resolve83.f90 @@ -3,7 +3,7 @@ module m ! For C1543 interface intFace - !WARNING: Attribute 'MODULE' cannot be used more than once + !WARNING: Attribute 'MODULE' cannot be used more than once [-Wredundant-attribute] module pure module real function moduleFunc() end function moduleFunc end interface @@ -27,17 +27,17 @@ end function moduleFunc real pure real function realFunc() end function realFunc - !WARNING: Attribute 'ELEMENTAL' cannot be used more than once + !WARNING: Attribute 'ELEMENTAL' cannot be used more than once [-Wredundant-attribute] elemental real elemental function elementalFunc(x) real, value :: x elementalFunc = x end function elementalFunc - !WARNING: Attribute 'IMPURE' cannot be used more than once + !WARNING: Attribute 'IMPURE' cannot be used more than once [-Wredundant-attribute] impure real impure function impureFunc() end function impureFunc - !WARNING: Attribute 'PURE' cannot be used more than once + !WARNING: Attribute 'PURE' cannot be used more than once [-Wredundant-attribute] pure real pure function pureFunc() end function pureFunc @@ -45,11 +45,11 @@ end function pureFunc impure real pure function impurePureFunc() end function impurePureFunc - !WARNING: Attribute 'RECURSIVE' cannot be used more than once + !WARNING: Attribute 'RECURSIVE' cannot be used more than once [-Wredundant-attribute] recursive real recursive function recursiveFunc() end function recursiveFunc - !WARNING: Attribute 'NON_RECURSIVE' cannot be used more than once + !WARNING: Attribute 'NON_RECURSIVE' cannot be used more than once [-Wredundant-attribute] non_recursive real non_recursive function non_recursiveFunc() end function non_recursiveFunc diff --git a/flang/test/Semantics/resolve85.f90 b/flang/test/Semantics/resolve85.f90 index 9b9358ecf4770..64b8081dd457b 100644 --- a/flang/test/Semantics/resolve85.f90 +++ b/flang/test/Semantics/resolve85.f90 @@ -7,15 +7,15 @@ module m ! TYPE [[, type-attr-spec-list] ::] type-name [( type-param-name-list )] ! type-attr-spec values are: ! ABSTRACT, PUBLIC, PRIVATE, BIND(C), EXTENDS(parent-type-name) - !WARNING: Attribute 'ABSTRACT' cannot be used more than once + !WARNING: Attribute 'ABSTRACT' cannot be used more than once [-Wredundant-attribute] type, abstract, public, abstract :: derived1 end type derived1 - !WARNING: Attribute 'PUBLIC' cannot be used more than once + !WARNING: Attribute 'PUBLIC' cannot be used more than once [-Wredundant-attribute] type, public, abstract, public :: derived2 end type derived2 - !WARNING: Attribute 'PRIVATE' cannot be used more than once + !WARNING: Attribute 'PRIVATE' cannot be used more than once [-Wredundant-attribute] type, private, abstract, private :: derived3 end type derived3 @@ -23,8 +23,8 @@ module m type, public, abstract, private :: derived4 end type derived4 - !WARNING: Attribute 'BIND(C)' cannot be used more than once - !WARNING: A derived type with the BIND attribute should not be empty + !WARNING: Attribute 'BIND(C)' cannot be used more than once [-Wredundant-attribute] + !WARNING: A derived type with the BIND attribute should not be empty [-Wempty-bind-c-derived-type] type, bind(c), public, bind(c) :: derived5 end type derived5 diff --git a/flang/test/Semantics/resolve90.f90 b/flang/test/Semantics/resolve90.f90 index baa108f4d0839..7d2b5e9d333ff 100644 --- a/flang/test/Semantics/resolve90.f90 +++ b/flang/test/Semantics/resolve90.f90 @@ -12,7 +12,7 @@ subroutine s() !ERROR: 'pointerallocatablefield' may not have both the POINTER and ALLOCATABLE attributes real, pointer, allocatable :: pointerAllocatableField real, dimension(:), contiguous, pointer :: goodContigField - !PORTABILITY: CONTIGUOUS component 'badcontigfield' should be an array with the POINTER attribute + !PORTABILITY: CONTIGUOUS component 'badcontigfield' should be an array with the POINTER attribute [-Wredundant-contiguous] real, dimension(:), contiguous, allocatable :: badContigField character :: charField * 3 !ERROR: A length specifier cannot be used to declare the non-character entity 'realfield' diff --git a/flang/test/Semantics/resolve99.f90 b/flang/test/Semantics/resolve99.f90 index e56022b61bfd8..796c354af1341 100644 --- a/flang/test/Semantics/resolve99.f90 +++ b/flang/test/Semantics/resolve99.f90 @@ -31,7 +31,7 @@ subroutine constructAssoc() integer, dimension(4) :: table integer :: localVar associate (assocVar => localVar) - !PORTABILITY: Index variable 'assocvar' should be a scalar object or common block if it is present in the enclosing scope + !PORTABILITY: Index variable 'assocvar' should be a scalar object or common block if it is present in the enclosing scope [-Wodd-index-variable-restrictions] FORALL (assocVar=1:4) table(assocVar) = 343 end associate end subroutine constructAssoc @@ -44,7 +44,7 @@ end subroutine commonSub subroutine mismatch() integer, dimension(4) :: table - !PORTABILITY: Index variable 'typename' should be a scalar object or common block if it is present in the enclosing scope + !PORTABILITY: Index variable 'typename' should be a scalar object or common block if it is present in the enclosing scope [-Wodd-index-variable-restrictions] !ERROR: Must have INTEGER type, but is REAL(4) !ERROR: Must have INTEGER type, but is REAL(4) FORALL (typeName=1:4) table(typeName) = 343 diff --git a/flang/test/Semantics/separate-mp02.f90 b/flang/test/Semantics/separate-mp02.f90 index cb1e2687bad73..7d8ea6e0c3932 100644 --- a/flang/test/Semantics/separate-mp02.f90 +++ b/flang/test/Semantics/separate-mp02.f90 @@ -368,7 +368,7 @@ module subroutine s(x) end submodule(m11) sm11 contains - !WARNING: Dummy procedure 'x' does not exactly match the corresponding argument in the interface body + !WARNING: Dummy procedure 'x' does not exactly match the corresponding argument in the interface body [-Wmismatching-dummy-procedure] module subroutine s(x) call x ! no error end diff --git a/flang/test/Semantics/spec-expr.f90 b/flang/test/Semantics/spec-expr.f90 index 28ebea1109f1d..4d79f2ca188fc 100644 --- a/flang/test/Semantics/spec-expr.f90 +++ b/flang/test/Semantics/spec-expr.f90 @@ -117,7 +117,7 @@ subroutine s7biii(x, y) integer :: local = 5 ! OK, since "localConst" is a constant real, dimension(localConst) :: realArray1 - !PORTABILITY: specification expression refers to local object 'local' (initialized and saved) + !PORTABILITY: specification expression refers to local object 'local' (initialized and saved) [-Wsaved-local-in-spec-expr] real, dimension(local) :: realArray2 real, dimension(size(realArray1)) :: realArray3 ! ok real, dimension(size(x)) :: realArray4 ! ok diff --git a/flang/test/Semantics/stmt-func01.f90 b/flang/test/Semantics/stmt-func01.f90 index a87b0d7af52b4..d8ef9af25b389 100644 --- a/flang/test/Semantics/stmt-func01.f90 +++ b/flang/test/Semantics/stmt-func01.f90 @@ -10,14 +10,14 @@ program main pure integer function ifunc() end function end interface - !PORTABILITY: Automatic data object 'x1' should not appear in the specification part of a main program + !PORTABILITY: Automatic data object 'x1' should not appear in the specification part of a main program [-Wautomatic-in-main-program] type(t1(k=4,l=ifunc())) x1 - !PORTABILITY: Statement function 'sf1' should not contain an array constructor + !PORTABILITY: Statement function 'sf1' should not contain an array constructor [-Wstatement-function-extensions] sf1(n) = sum([(j,j=1,n)]) type(t1) sf2 - !PORTABILITY: Statement function 'sf2' should not contain a structure constructor + !PORTABILITY: Statement function 'sf2' should not contain a structure constructor [-Wstatement-function-extensions] sf2(n) = t1(n) - !PORTABILITY: Statement function 'sf3' should not contain a type parameter inquiry + !PORTABILITY: Statement function 'sf3' should not contain a type parameter inquiry [-Wstatement-function-extensions] sf3(n) = x1%l !ERROR: Recursive call to statement function 'sf4' is not allowed sf4(n) = sf4(n) @@ -26,10 +26,10 @@ pure integer function ifunc() real sf7 !ERROR: Statement function 'sf6' may not reference another statement function 'sf7' that is defined later sf6(n) = sf7(n) - !PORTABILITY: Statement function 'sf7' should not reference function 'explicit' that requires an explicit interface + !PORTABILITY: Statement function 'sf7' should not reference function 'explicit' that requires an explicit interface [-Wstatement-function-extensions] sf7(n) = explicit(n) real :: a(3) = [1., 2., 3.] - !PORTABILITY: Statement function 'sf8' should not pass an array argument that is not a whole array + !PORTABILITY: Statement function 'sf8' should not pass an array argument that is not a whole array [-Wstatement-function-extensions] sf8(n) = sum(a(1:2)) sf8a(n) = sum(a) ! ok integer :: sf9 @@ -56,7 +56,7 @@ pure function arr() arr = [1., 2.] end function subroutine foo - !PORTABILITY: An implicitly typed statement function should not appear when the same symbol is available in its host scope + !PORTABILITY: An implicitly typed statement function should not appear when the same symbol is available in its host scope [-Wstatement-function-extensions] sf14(x) = 2.*x end subroutine end @@ -94,7 +94,7 @@ subroutine s4 subroutine s5 !ERROR: Invalid specification expression: reference to impure function 'k' real x(k()) - !WARNING: Name 'k' from host scope should have a type declaration before its local statement function definition + !WARNING: Name 'k' from host scope should have a type declaration before its local statement function definition [-Wstatement-function-extensions] !ERROR: 'k' is already declared in this scoping unit k() = 0.0 end diff --git a/flang/test/Semantics/stmt-func02.f90 b/flang/test/Semantics/stmt-func02.f90 index bfed280ded58d..10166a0abf7b1 100644 --- a/flang/test/Semantics/stmt-func02.f90 +++ b/flang/test/Semantics/stmt-func02.f90 @@ -24,11 +24,11 @@ subroutine test1 print *, x end subroutine test2 - !PORTABILITY: Name 'rf' from host scope should have a type declaration before its local statement function definition + !PORTABILITY: Name 'rf' from host scope should have a type declaration before its local statement function definition [-Wstatement-function-extensions] rf(x) = 1. end subroutine test2b - !PORTABILITY: Name 'rf2' from host scope should have a type declaration before its local statement function definition + !PORTABILITY: Name 'rf2' from host scope should have a type declaration before its local statement function definition [-Wstatement-function-extensions] rf2(x) = 1. end subroutine test3 @@ -43,7 +43,7 @@ function f() f() = 1. ! statement function of same name as function end function g() result(r) - !WARNING: Name 'g' from host scope should have a type declaration before its local statement function definition + !WARNING: Name 'g' from host scope should have a type declaration before its local statement function definition [-Wstatement-function-extensions] !ERROR: 'g' is already declared in this scoping unit g() = 1. ! statement function of same name as function end diff --git a/flang/test/Semantics/structconst03.f90 b/flang/test/Semantics/structconst03.f90 index ecd31723b12bb..006f21e5b29f7 100644 --- a/flang/test/Semantics/structconst03.f90 +++ b/flang/test/Semantics/structconst03.f90 @@ -183,7 +183,7 @@ impure real function ipf1(dummy1, dummy2, dummy3, dummy4) x1 = t1(0)(usedfrom1) x1 = t1(0)(modulevar1) x1 = t1(0)(commonvar1) - !WARNING: Pointer target is not a definable variable + !WARNING: Pointer target is not a definable variable [-Wpointer-to-undefinable] !BECAUSE: 'dummy1' is an INTENT(IN) dummy argument x1 = t1(0)(dummy1) x1 = t1(0)(dummy2) diff --git a/flang/test/Semantics/structconst04.f90 b/flang/test/Semantics/structconst04.f90 index abddf6001726c..b44f87aeb13f0 100644 --- a/flang/test/Semantics/structconst04.f90 +++ b/flang/test/Semantics/structconst04.f90 @@ -177,7 +177,7 @@ impure real function ipf1(dummy1, dummy2, dummy3, dummy4) x1 = t1(usedfrom1) x1 = t1(modulevar1) x1 = t1(commonvar1) - !WARNING: Pointer target is not a definable variable + !WARNING: Pointer target is not a definable variable [-Wpointer-to-undefinable] !BECAUSE: 'dummy1' is an INTENT(IN) dummy argument x1 = t1(dummy1) x1 = t1(dummy2) diff --git a/flang/test/Semantics/structconst08.f90 b/flang/test/Semantics/structconst08.f90 index 149c898dda9d4..78e44a49735d8 100644 --- a/flang/test/Semantics/structconst08.f90 +++ b/flang/test/Semantics/structconst08.f90 @@ -25,7 +25,7 @@ subroutine test1() !ERROR: Must be a constant value type(parent1) :: tp2 = parent1(j) type(parent1) :: tp3 = parent1(null()) -!PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'pa' +!PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'pa' [-Wnull-mold-allocatable-component-value] type(parent1) :: tp4 = parent1(null(ipp)) !ERROR: Must be a constant value @@ -33,7 +33,7 @@ subroutine test1() !ERROR: Must be a constant value type(parent2) :: tp6 = parent2(arr) type(parent2) :: tp7 = parent2(null()) -!PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'pa' +!PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'pa' [-Wnull-mold-allocatable-component-value] type(parent2) :: tp8 = parent2(null(rpp)) end subroutine test1 @@ -47,20 +47,20 @@ subroutine test2() tp1 = parent1(3) tp1 = parent1(j) tp1 = parent1(null()) -!PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'pa' +!PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'pa' [-Wnull-mold-allocatable-component-value] tp1 = parent1(null(ipp)) tp2 = parent2([1.1,2.1,3.1]) tp2 = parent2(arr) tp2 = parent2(null()) -!PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'pa' +!PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'pa' [-Wnull-mold-allocatable-component-value] tp2 = parent2(null(rpp)) end subroutine test2 subroutine test3() real, pointer :: pp(:) type(child) :: tc1 = child(5, parent2(null())) -!PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'pa' +!PORTABILITY: NULL() with arguments is not standard conforming as the value for allocatable component 'pa' [-Wnull-mold-allocatable-component-value] type(child) :: tc10 = child(5, parent2(null(pp))) !ERROR: Must be a constant value type(child) :: tc3 = child(5, parent2([1.1,1.2])) diff --git a/flang/test/Semantics/structconst10.f90 b/flang/test/Semantics/structconst10.f90 index 582f8fc15704f..e6a22a9bfac55 100644 --- a/flang/test/Semantics/structconst10.f90 +++ b/flang/test/Semantics/structconst10.f90 @@ -14,12 +14,12 @@ end module m1 program test use m1 type(a3) v - !PORTABILITY: Whole parent component 'a2' in structure constructor should not be anonymous + !PORTABILITY: Whole parent component 'a2' in structure constructor should not be anonymous [-Wanonymous-parents] v=a3(a2(x1=18,x2=6),x3=6) - !PORTABILITY: Whole parent component 'a1' in structure constructor should not be anonymous + !PORTABILITY: Whole parent component 'a1' in structure constructor should not be anonymous [-Wanonymous-parents] v=a3(a1(x1=18),x2=6,x3=6) - !PORTABILITY: Whole parent component 'a2' in structure constructor should not be anonymous - !PORTABILITY: Whole parent component 'a1' in structure constructor should not be anonymous + !PORTABILITY: Whole parent component 'a2' in structure constructor should not be anonymous [-Wanonymous-parents] + !PORTABILITY: Whole parent component 'a1' in structure constructor should not be anonymous [-Wanonymous-parents] v=a3(a2(a1(x1=18),x2=6),x3=6) v=a3(a2=a2(a1=a1(x1=18),x2=6),x3=6) ! ok end diff --git a/flang/test/Semantics/transfer01.f90 b/flang/test/Semantics/transfer01.f90 index 26f4f1b3eb62f..d58cf1a4408e7 100644 --- a/flang/test/Semantics/transfer01.f90 +++ b/flang/test/Semantics/transfer01.f90 @@ -20,17 +20,17 @@ subroutine subr(o) print *, transfer(1., empty2) ! ok !ERROR: Element size of MOLD= array may not be zero when SOURCE= is not empty print *, transfer(1., empty3) - !WARNING: Element size of MOLD= array may not be zero unless SOURCE= is empty + !WARNING: Element size of MOLD= array may not be zero unless SOURCE= is empty [-Wvoid-mold] print *, transfer(source, empty1) print *, transfer(source, empty2) ! ok - !WARNING: Element size of MOLD= array may not be zero unless SOURCE= is empty + !WARNING: Element size of MOLD= array may not be zero unless SOURCE= is empty [-Wvoid-mold] print *, transfer(source, empty3) !ERROR: SIZE= argument may not be the optional dummy argument 'o' print *, transfer(1., empty2, size=o) - !WARNING: SIZE= argument that is allocatable or pointer must be present at execution; parenthesize to silence this warning + !WARNING: SIZE= argument that is allocatable or pointer must be present at execution; parenthesize to silence this warning [-Wtransfer-size-presence] print *, transfer(1., empty2, size=ia) - !WARNING: SIZE= argument that is allocatable or pointer must be present at execution; parenthesize to silence this warning + !WARNING: SIZE= argument that is allocatable or pointer must be present at execution; parenthesize to silence this warning [-Wtransfer-size-presence] print *, transfer(1., empty2, size=ip) - !WARNING: Source of TRANSFER contains allocatable or pointer component %allocatable + !WARNING: Source of TRANSFER contains allocatable or pointer component %allocatable [-Wpointer-component-transfer-arg] print *, transfer(hasDesc, 1) end diff --git a/flang/test/Semantics/undef-result01.f90 b/flang/test/Semantics/undef-result01.f90 index e1ae58dae7c0a..85cd181cd4413 100644 --- a/flang/test/Semantics/undef-result01.f90 +++ b/flang/test/Semantics/undef-result01.f90 @@ -1,6 +1,6 @@ ! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror -!WARNING: Function result is never defined +!WARNING: Function result is never defined [-Wundefined-function-result] function basic() end @@ -29,7 +29,7 @@ subroutine intentInPtr(p) end end -!WARNING: Function result is never defined +!WARNING: Function result is never defined [-Wundefined-function-result] function notDefdByCall() call intentin(notDefdByCall) contains @@ -38,7 +38,7 @@ subroutine intentin(n) end end -!WARNING: Function result is never defined +!WARNING: Function result is never defined [-Wundefined-function-result] function basicAlloc() real, allocatable :: basicAlloc allocate(basicAlloc) @@ -134,7 +134,7 @@ integer function defdBySize() inquire(6,status=defdByInquire) end -!WARNING: Function result is never defined +!WARNING: Function result is never defined [-Wundefined-function-result] character(20) function notDefdByInquire() inquire(file=notDefdByInquire) end diff --git a/flang/unittests/Common/FortranFeaturesTest.cpp b/flang/unittests/Common/FortranFeaturesTest.cpp index afd677f69a165..9408da0361e1d 100644 --- a/flang/unittests/Common/FortranFeaturesTest.cpp +++ b/flang/unittests/Common/FortranFeaturesTest.cpp @@ -558,4 +558,12 @@ TEST(FortranFeaturesTest, CamelCaseToLowerCaseHyphenated) { "non-volatile-pointer-to-volatile"); } +TEST(FortranFeaturesTest, HintLanguageControlFlag) { + LanguageFeatureControl control{}; + EXPECT_EQ(control.getDefaultCliSpelling(LanguageFeature::BenignNameClash), + "benign-name-clash"); + EXPECT_EQ( + control.getDefaultCliSpelling(UsageWarning::Portability), "portability"); +} + } // namespace Fortran::common::details