forked from OSchip/llvm-project
[flang] Remove periods from the ends of messages, per review comment
Original-commit: flang-compiler/f18@0ce32de0d6 Reviewed-on: https://github.com/flang-compiler/f18/pull/745
This commit is contained in:
parent
9c3a9375be
commit
1c10d963aa
|
@ -30,24 +30,24 @@ static void CheckSymbol(SemanticsContext &context, const Symbol &symbol) {
|
||||||
if (IsAssumedLengthCharacterFunction(symbol)) { // C723
|
if (IsAssumedLengthCharacterFunction(symbol)) { // C723
|
||||||
if (symbol.attrs().test(Attr::RECURSIVE)) {
|
if (symbol.attrs().test(Attr::RECURSIVE)) {
|
||||||
context.Say(
|
context.Say(
|
||||||
"An assumed-length CHARACTER(*) function cannot be RECURSIVE."_err_en_US);
|
"An assumed-length CHARACTER(*) function cannot be RECURSIVE"_err_en_US);
|
||||||
}
|
}
|
||||||
if (symbol.Rank() > 0) {
|
if (symbol.Rank() > 0) {
|
||||||
context.Say(
|
context.Say(
|
||||||
"An assumed-length CHARACTER(*) function cannot return an array."_err_en_US);
|
"An assumed-length CHARACTER(*) function cannot return an array"_err_en_US);
|
||||||
}
|
}
|
||||||
if (symbol.attrs().test(Attr::PURE)) {
|
if (symbol.attrs().test(Attr::PURE)) {
|
||||||
context.Say(
|
context.Say(
|
||||||
"An assumed-length CHARACTER(*) function cannot be PURE."_err_en_US);
|
"An assumed-length CHARACTER(*) function cannot be PURE"_err_en_US);
|
||||||
}
|
}
|
||||||
if (symbol.attrs().test(Attr::ELEMENTAL)) {
|
if (symbol.attrs().test(Attr::ELEMENTAL)) {
|
||||||
context.Say(
|
context.Say(
|
||||||
"An assumed-length CHARACTER(*) function cannot be ELEMENTAL."_err_en_US);
|
"An assumed-length CHARACTER(*) function cannot be ELEMENTAL"_err_en_US);
|
||||||
}
|
}
|
||||||
if (const Symbol * result{FindFunctionResult(symbol)}) {
|
if (const Symbol * result{FindFunctionResult(symbol)}) {
|
||||||
if (result->attrs().test(Attr::POINTER)) {
|
if (result->attrs().test(Attr::POINTER)) {
|
||||||
context.Say(
|
context.Say(
|
||||||
"An assumed-length CHARACTER(*) function cannot return a POINTER."_err_en_US);
|
"An assumed-length CHARACTER(*) function cannot return a POINTER"_err_en_US);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ bool OmpStructureChecker::HasInvalidWorksharingNesting(
|
||||||
context_.Say(source,
|
context_.Say(source,
|
||||||
"A worksharing region may not be closely nested inside a "
|
"A worksharing region may not be closely nested inside a "
|
||||||
"worksharing, explicit task, taskloop, critical, ordered, atomic, or "
|
"worksharing, explicit task, taskloop, critical, ordered, atomic, or "
|
||||||
"master region."_err_en_US);
|
"master region"_err_en_US);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1501,7 +1501,7 @@ auto ExpressionAnalyzer::Procedure(const parser::ProcedureDesignator &pd,
|
||||||
if (symbol.attrs().test(
|
if (symbol.attrs().test(
|
||||||
semantics::Attr::NON_RECURSIVE)) { // 15.6.2.1(3)
|
semantics::Attr::NON_RECURSIVE)) { // 15.6.2.1(3)
|
||||||
if (auto *msg{Say(
|
if (auto *msg{Say(
|
||||||
"NON_RECURSIVE procedure '%s' cannot call itself."_err_en_US,
|
"NON_RECURSIVE procedure '%s' cannot call itself"_err_en_US,
|
||||||
n.source)}) {
|
n.source)}) {
|
||||||
msg->Attach(
|
msg->Attach(
|
||||||
symbol.name(), "definition of '%s'"_en_US, n.source);
|
symbol.name(), "definition of '%s'"_en_US, n.source);
|
||||||
|
@ -1509,7 +1509,7 @@ auto ExpressionAnalyzer::Procedure(const parser::ProcedureDesignator &pd,
|
||||||
} else if (IsAssumedLengthCharacterFunction(
|
} else if (IsAssumedLengthCharacterFunction(
|
||||||
symbol)) { // 15.6.2.1(3)
|
symbol)) { // 15.6.2.1(3)
|
||||||
if (auto *msg{Say(
|
if (auto *msg{Say(
|
||||||
"Assumed-length CHARACTER(*) function '%s' cannot call itself."_err_en_US,
|
"Assumed-length CHARACTER(*) function '%s' cannot call itself"_err_en_US,
|
||||||
n.source)}) {
|
n.source)}) {
|
||||||
msg->Attach(
|
msg->Attach(
|
||||||
symbol.name(), "definition of '%s'"_en_US, n.source);
|
symbol.name(), "definition of '%s'"_en_US, n.source);
|
||||||
|
@ -1569,7 +1569,7 @@ std::optional<ActualArgument> ExpressionAnalyzer::AnalyzeActualArgument(
|
||||||
if (!std::holds_alternative<SpecificIntrinsic>(proc->u) &&
|
if (!std::holds_alternative<SpecificIntrinsic>(proc->u) &&
|
||||||
proc->IsElemental()) { // C1533
|
proc->IsElemental()) { // C1533
|
||||||
Say(expr.source,
|
Say(expr.source,
|
||||||
"Non-intrinsic ELEMENTAL procedure cannot be passed as argument."_err_en_US);
|
"Non-intrinsic ELEMENTAL procedure cannot be passed as argument"_err_en_US);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (auto coarrayRef{ExtractCoarrayRef(x)}) {
|
if (auto coarrayRef{ExtractCoarrayRef(x)}) {
|
||||||
|
@ -1578,7 +1578,7 @@ std::optional<ActualArgument> ExpressionAnalyzer::AnalyzeActualArgument(
|
||||||
if (const semantics::DerivedTypeSpec * derived{type->AsDerived()}) {
|
if (const semantics::DerivedTypeSpec * derived{type->AsDerived()}) {
|
||||||
if (auto ptr{semantics::FindPointerUltimateComponent(*derived)}) {
|
if (auto ptr{semantics::FindPointerUltimateComponent(*derived)}) {
|
||||||
if (auto *msg{Say(expr.source,
|
if (auto *msg{Say(expr.source,
|
||||||
"Coindexed object '%s' with POINTER ultimate component '%s' cannot be passed as argument."_err_en_US,
|
"Coindexed object '%s' with POINTER ultimate component '%s' cannot be passed as argument"_err_en_US,
|
||||||
coarray.name(), (*ptr)->name())}) {
|
coarray.name(), (*ptr)->name())}) {
|
||||||
msg->Attach((*ptr)->name(),
|
msg->Attach((*ptr)->name(),
|
||||||
"Declaration of POINTER '%s' component of %s"_en_US,
|
"Declaration of POINTER '%s' component of %s"_en_US,
|
||||||
|
@ -1672,7 +1672,7 @@ MaybeExpr ExpressionAnalyzer::Analyze(const parser::Expr::Parentheses &x) {
|
||||||
if (const semantics::Symbol * result{FindFunctionResult(*symbol)}) {
|
if (const semantics::Symbol * result{FindFunctionResult(*symbol)}) {
|
||||||
if (semantics::IsProcedurePointer(*result)) {
|
if (semantics::IsProcedurePointer(*result)) {
|
||||||
Say("A function reference that returns a procedure "
|
Say("A function reference that returns a procedure "
|
||||||
"pointer may not be parenthesized."_err_en_US); // C1003
|
"pointer may not be parenthesized"_err_en_US); // C1003
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2100,7 +2100,7 @@ Scope *ModuleVisitor::FindModule(const parser::Name &name, Scope *ancestor) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
if (DoesScopeContain(scope, currScope())) { // 14.2.2(1)
|
if (DoesScopeContain(scope, currScope())) { // 14.2.2(1)
|
||||||
Say(name, "Module '%s' cannot USE itself."_err_en_US);
|
Say(name, "Module '%s' cannot USE itself"_err_en_US);
|
||||||
}
|
}
|
||||||
Resolve(name, scope->symbol());
|
Resolve(name, scope->symbol());
|
||||||
return scope;
|
return scope;
|
||||||
|
|
|
@ -20,7 +20,7 @@ non_recursive function f01(n) result(res)
|
||||||
if (n <= 0) then
|
if (n <= 0) then
|
||||||
res = n
|
res = n
|
||||||
else
|
else
|
||||||
!ERROR: NON_RECURSIVE procedure 'f01' cannot call itself.
|
!ERROR: NON_RECURSIVE procedure 'f01' cannot call itself
|
||||||
res = n * f01(n-1) ! 15.6.2.1(3)
|
res = n * f01(n-1) ! 15.6.2.1(3)
|
||||||
end if
|
end if
|
||||||
end function
|
end function
|
||||||
|
@ -35,68 +35,68 @@ non_recursive function f02(n) result(res)
|
||||||
end if
|
end if
|
||||||
contains
|
contains
|
||||||
integer function nested
|
integer function nested
|
||||||
!ERROR: NON_RECURSIVE procedure 'f02' cannot call itself.
|
!ERROR: NON_RECURSIVE procedure 'f02' cannot call itself
|
||||||
nested = n * f02(n-1) ! 15.6.2.1(3)
|
nested = n * f02(n-1) ! 15.6.2.1(3)
|
||||||
end function nested
|
end function nested
|
||||||
end function
|
end function
|
||||||
|
|
||||||
!ERROR: An assumed-length CHARACTER(*) function cannot be RECURSIVE.
|
!ERROR: An assumed-length CHARACTER(*) function cannot be RECURSIVE
|
||||||
recursive character(*) function f03(n) ! C723
|
recursive character(*) function f03(n) ! C723
|
||||||
integer, value :: n
|
integer, value :: n
|
||||||
f03 = ''
|
f03 = ''
|
||||||
end function
|
end function
|
||||||
|
|
||||||
!ERROR: An assumed-length CHARACTER(*) function cannot be RECURSIVE.
|
!ERROR: An assumed-length CHARACTER(*) function cannot be RECURSIVE
|
||||||
recursive function f04(n) result(res) ! C723
|
recursive function f04(n) result(res) ! C723
|
||||||
integer, value :: n
|
integer, value :: n
|
||||||
character(*) :: res
|
character(*) :: res
|
||||||
res = ''
|
res = ''
|
||||||
end function
|
end function
|
||||||
|
|
||||||
!ERROR: An assumed-length CHARACTER(*) function cannot return an array.
|
!ERROR: An assumed-length CHARACTER(*) function cannot return an array
|
||||||
character(*) function f05()
|
character(*) function f05()
|
||||||
dimension :: f05(1) ! C723
|
dimension :: f05(1) ! C723
|
||||||
f05(1) = ''
|
f05(1) = ''
|
||||||
end function
|
end function
|
||||||
|
|
||||||
!ERROR: An assumed-length CHARACTER(*) function cannot return an array.
|
!ERROR: An assumed-length CHARACTER(*) function cannot return an array
|
||||||
function f06()
|
function f06()
|
||||||
character(*) :: f06(1) ! C723
|
character(*) :: f06(1) ! C723
|
||||||
f06(1) = ''
|
f06(1) = ''
|
||||||
end function
|
end function
|
||||||
|
|
||||||
!ERROR: An assumed-length CHARACTER(*) function cannot return a POINTER.
|
!ERROR: An assumed-length CHARACTER(*) function cannot return a POINTER
|
||||||
character(*) function f07()
|
character(*) function f07()
|
||||||
pointer :: f07 ! C723
|
pointer :: f07 ! C723
|
||||||
character, target :: a = ' '
|
character, target :: a = ' '
|
||||||
f07 => a
|
f07 => a
|
||||||
end function
|
end function
|
||||||
|
|
||||||
!ERROR: An assumed-length CHARACTER(*) function cannot return a POINTER.
|
!ERROR: An assumed-length CHARACTER(*) function cannot return a POINTER
|
||||||
function f08()
|
function f08()
|
||||||
character(*), pointer :: f08 ! C723
|
character(*), pointer :: f08 ! C723
|
||||||
character, target :: a = ' '
|
character, target :: a = ' '
|
||||||
f08 => a
|
f08 => a
|
||||||
end function
|
end function
|
||||||
|
|
||||||
!ERROR: An assumed-length CHARACTER(*) function cannot be PURE.
|
!ERROR: An assumed-length CHARACTER(*) function cannot be PURE
|
||||||
pure character(*) function f09() ! C723
|
pure character(*) function f09() ! C723
|
||||||
f09 = ''
|
f09 = ''
|
||||||
end function
|
end function
|
||||||
|
|
||||||
!ERROR: An assumed-length CHARACTER(*) function cannot be PURE.
|
!ERROR: An assumed-length CHARACTER(*) function cannot be PURE
|
||||||
pure function f10()
|
pure function f10()
|
||||||
character(*) :: f10 ! C723
|
character(*) :: f10 ! C723
|
||||||
f10 = ''
|
f10 = ''
|
||||||
end function
|
end function
|
||||||
|
|
||||||
!ERROR: An assumed-length CHARACTER(*) function cannot be ELEMENTAL.
|
!ERROR: An assumed-length CHARACTER(*) function cannot be ELEMENTAL
|
||||||
elemental character(*) function f11(n) ! C723
|
elemental character(*) function f11(n) ! C723
|
||||||
integer, value :: n
|
integer, value :: n
|
||||||
f11 = ''
|
f11 = ''
|
||||||
end function
|
end function
|
||||||
|
|
||||||
!ERROR: An assumed-length CHARACTER(*) function cannot be ELEMENTAL.
|
!ERROR: An assumed-length CHARACTER(*) function cannot be ELEMENTAL
|
||||||
elemental function f12(n)
|
elemental function f12(n)
|
||||||
character(*) :: f12 ! C723
|
character(*) :: f12 ! C723
|
||||||
integer, value :: n
|
integer, value :: n
|
||||||
|
@ -109,7 +109,7 @@ function f13(n) result(res)
|
||||||
if (n <= 0) then
|
if (n <= 0) then
|
||||||
res = ''
|
res = ''
|
||||||
else
|
else
|
||||||
!ERROR: Assumed-length CHARACTER(*) function 'f13' cannot call itself.
|
!ERROR: Assumed-length CHARACTER(*) function 'f13' cannot call itself
|
||||||
res = f13(n-1) ! 15.6.2.1(3)
|
res = f13(n-1) ! 15.6.2.1(3)
|
||||||
end if
|
end if
|
||||||
end function
|
end function
|
||||||
|
@ -124,7 +124,7 @@ function f14(n) result(res)
|
||||||
end if
|
end if
|
||||||
contains
|
contains
|
||||||
character(1) function nested
|
character(1) function nested
|
||||||
!ERROR: Assumed-length CHARACTER(*) function 'f14' cannot call itself.
|
!ERROR: Assumed-length CHARACTER(*) function 'f14' cannot call itself
|
||||||
nested = f14(n-1) ! 15.6.2.1(3)
|
nested = f14(n-1) ! 15.6.2.1(3)
|
||||||
end function nested
|
end function nested
|
||||||
end function
|
end function
|
||||||
|
|
|
@ -27,7 +27,7 @@ subroutine s01(elem, subr)
|
||||||
end subroutine
|
end subroutine
|
||||||
end interface
|
end interface
|
||||||
call subr(cos) ! not an error
|
call subr(cos) ! not an error
|
||||||
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument.
|
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument
|
||||||
call subr(elem) ! C1533
|
call subr(elem) ! C1533
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
|
@ -47,13 +47,13 @@ module m01
|
||||||
end function
|
end function
|
||||||
subroutine test
|
subroutine test
|
||||||
call callme(cos) ! not an error
|
call callme(cos) ! not an error
|
||||||
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument.
|
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument
|
||||||
call callme(elem01) ! C1533
|
call callme(elem01) ! C1533
|
||||||
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument.
|
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument
|
||||||
call callme(elem02) ! C1533
|
call callme(elem02) ! C1533
|
||||||
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument.
|
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument
|
||||||
call callme(elem03) ! C1533
|
call callme(elem03) ! C1533
|
||||||
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument.
|
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument
|
||||||
call callme(elem04) ! C1533
|
call callme(elem04) ! C1533
|
||||||
contains
|
contains
|
||||||
elemental real function elem04(x)
|
elemental real function elem04(x)
|
||||||
|
@ -72,7 +72,7 @@ module m02
|
||||||
type(t), intent(in) :: x
|
type(t), intent(in) :: x
|
||||||
end subroutine
|
end subroutine
|
||||||
subroutine test
|
subroutine test
|
||||||
!ERROR: Coindexed object 'coarray' with POINTER ultimate component 'ptr' cannot be passed as argument.
|
!ERROR: Coindexed object 'coarray' with POINTER ultimate component 'ptr' cannot be passed as argument
|
||||||
call callee(coarray[1]) ! C1537
|
call callee(coarray[1]) ! C1537
|
||||||
end subroutine
|
end subroutine
|
||||||
end module
|
end module
|
||||||
|
|
|
@ -35,27 +35,27 @@ module m
|
||||||
real, allocatable, intent(out) :: x(:)
|
real, allocatable, intent(out) :: x(:)
|
||||||
end subroutine
|
end subroutine
|
||||||
subroutine s01b ! C846 - can only be caught at a call via explicit interface
|
subroutine s01b ! C846 - can only be caught at a call via explicit interface
|
||||||
!ERROR: An allocatable coarray cannot be associated with an INTENT(OUT) dummy argument.
|
!ERROR: An allocatable coarray cannot be associated with an INTENT(OUT) dummy argument
|
||||||
call s01a(coarray)
|
call s01a(coarray)
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
subroutine s02(x) ! C846
|
subroutine s02(x) ! C846
|
||||||
!ERROR: An INTENT(OUT) argument must not contain an allocatable coarray.
|
!ERROR: An INTENT(OUT) argument must not contain an allocatable coarray
|
||||||
type(hasCoarray), intent(out) :: x
|
type(hasCoarray), intent(out) :: x
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
subroutine s03(x) ! C846
|
subroutine s03(x) ! C846
|
||||||
!ERROR: An INTENT(OUT) argument must not contain an allocatable coarray.
|
!ERROR: An INTENT(OUT) argument must not contain an allocatable coarray
|
||||||
type(extendsHasCoarray), intent(out) :: x
|
type(extendsHasCoarray), intent(out) :: x
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
subroutine s04(x) ! C846
|
subroutine s04(x) ! C846
|
||||||
!ERROR: An INTENT(OUT) argument must not contain an allocatable coarray.
|
!ERROR: An INTENT(OUT) argument must not contain an allocatable coarray
|
||||||
type(hasCoarray2), intent(out) :: x
|
type(hasCoarray2), intent(out) :: x
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
subroutine s05(x) ! C846
|
subroutine s05(x) ! C846
|
||||||
!ERROR: An INTENT(OUT) argument must not contain an allocatable coarray.
|
!ERROR: An INTENT(OUT) argument must not contain an allocatable coarray
|
||||||
type(extendsHasCoarray2), intent(out) :: x
|
type(extendsHasCoarray2), intent(out) :: x
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
|
@ -63,12 +63,12 @@ end module
|
||||||
|
|
||||||
subroutine s06(x) ! C847
|
subroutine s06(x) ! C847
|
||||||
use ISO_FORTRAN_ENV, only: lock_type
|
use ISO_FORTRAN_ENV, only: lock_type
|
||||||
!ERROR: A dummy argument of TYPE(LOCK_TYPE) cannot be INTENT(OUT).
|
!ERROR: A dummy argument of TYPE(LOCK_TYPE) cannot be INTENT(OUT)
|
||||||
type(lock_type), intent(out) :: x
|
type(lock_type), intent(out) :: x
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
subroutine s07(x) ! C847
|
subroutine s07(x) ! C847
|
||||||
use ISO_FORTRAN_ENV, only: event_type
|
use ISO_FORTRAN_ENV, only: event_type
|
||||||
!ERROR: A dummy argument of TYPE(EVENT_TYPE) cannot be INTENT(OUT).
|
!ERROR: A dummy argument of TYPE(EVENT_TYPE) cannot be INTENT(OUT)
|
||||||
type(event_type), intent(out) :: x
|
type(event_type), intent(out) :: x
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
|
@ -76,41 +76,41 @@ module m
|
||||||
call sma(ma) ! ok
|
call sma(ma) ! ok
|
||||||
call spp(pp) ! ok
|
call spp(pp) ! ok
|
||||||
call spa(pa) ! ok
|
call spa(pa) ! ok
|
||||||
!ERROR: If a dummy or effective argument is polymorphic, both must be so.
|
!ERROR: If a dummy or effective argument is polymorphic, both must be so
|
||||||
call smp(pp)
|
call smp(pp)
|
||||||
!ERROR: If a dummy or effective argument is polymorphic, both must be so.
|
!ERROR: If a dummy or effective argument is polymorphic, both must be so
|
||||||
call sma(pp)
|
call sma(pp)
|
||||||
!ERROR: If a dummy or effective argument is polymorphic, both must be so.
|
!ERROR: If a dummy or effective argument is polymorphic, both must be so
|
||||||
call spp(mp)
|
call spp(mp)
|
||||||
!ERROR: If a dummy or effective argument is polymorphic, both must be so.
|
!ERROR: If a dummy or effective argument is polymorphic, both must be so
|
||||||
call spa(mp)
|
call spa(mp)
|
||||||
!ERROR: If a dummy or effective argument is unlimited polymorphic, both must be so.
|
!ERROR: If a dummy or effective argument is unlimited polymorphic, both must be so
|
||||||
call sup(pp)
|
call sup(pp)
|
||||||
!ERROR: If a dummy or effective argument is unlimited polymorphic, both must be so.
|
!ERROR: If a dummy or effective argument is unlimited polymorphic, both must be so
|
||||||
call sua(pa)
|
call sua(pa)
|
||||||
!ERROR: If a dummy or effective argument is unlimited polymorphic, both must be so.
|
!ERROR: If a dummy or effective argument is unlimited polymorphic, both must be so
|
||||||
call spp(up)
|
call spp(up)
|
||||||
!ERROR: If a dummy or effective argument is unlimited polymorphic, both must be so.
|
!ERROR: If a dummy or effective argument is unlimited polymorphic, both must be so
|
||||||
call spa(ua)
|
call spa(ua)
|
||||||
!ERROR: Dummy and effective arguments must have the same declared type.
|
!ERROR: Dummy and effective arguments must have the same declared type
|
||||||
call spp(pp2)
|
call spp(pp2)
|
||||||
!ERROR: Dummy and effective arguments must have the same declared type.
|
!ERROR: Dummy and effective arguments must have the same declared type
|
||||||
call spa(pa2)
|
call spa(pa2)
|
||||||
!ERROR: Dummy argument has rank 1, but effective argument has rank 2.
|
!ERROR: Dummy argument has rank 1, but effective argument has rank 2
|
||||||
call smp(mpmat)
|
call smp(mpmat)
|
||||||
!ERROR: Dummy argument has rank 1, but effective argument has rank 2.
|
!ERROR: Dummy argument has rank 1, but effective argument has rank 2
|
||||||
call sma(mamat)
|
call sma(mamat)
|
||||||
call sdmp(dmp) ! ok
|
call sdmp(dmp) ! ok
|
||||||
call sdma(dma) ! ok
|
call sdma(dma) ! ok
|
||||||
call snmp(nmp) ! ok
|
call snmp(nmp) ! ok
|
||||||
call snma(nma) ! ok
|
call snma(nma) ! ok
|
||||||
!ERROR: Dummy and effective arguments must defer the same type parameters.
|
!ERROR: Dummy and effective arguments must defer the same type parameters
|
||||||
call sdmp(nmp)
|
call sdmp(nmp)
|
||||||
!ERROR: Dummy and effective arguments must defer the same type parameters.
|
!ERROR: Dummy and effective arguments must defer the same type parameters
|
||||||
call sdma(nma)
|
call sdma(nma)
|
||||||
!ERROR: Dummy and effective arguments must defer the same type parameters.
|
!ERROR: Dummy and effective arguments must defer the same type parameters
|
||||||
call snmp(dmp)
|
call snmp(dmp)
|
||||||
!ERROR: Dummy and effective arguments must defer the same type parameters.
|
!ERROR: Dummy and effective arguments must defer the same type parameters
|
||||||
call snma(dma)
|
call snma(dma)
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
|
|
|
@ -61,9 +61,9 @@ module m
|
||||||
call s04(cov[1]) ! ok
|
call s04(cov[1]) ! ok
|
||||||
!ERROR: Coindexed ALLOCATABLE effective argument must be associated with INTENT(IN) dummy argument
|
!ERROR: Coindexed ALLOCATABLE effective argument must be associated with INTENT(IN) dummy argument
|
||||||
call s01(cov[1])
|
call s01(cov[1])
|
||||||
!ERROR: Effective argument associated with INTENT(OUT) dummy is not definable.
|
!ERROR: Effective argument associated with INTENT(OUT) dummy is not definable
|
||||||
call s05(x)
|
call s05(x)
|
||||||
!ERROR: Effective argument associated with INTENT(IN OUT) dummy is not definable.
|
!ERROR: Effective argument associated with INTENT(IN OUT) dummy is not definable
|
||||||
call s06(x)
|
call s06(x)
|
||||||
end subroutine
|
end subroutine
|
||||||
end module
|
end module
|
||||||
|
|
|
@ -123,7 +123,7 @@ module m
|
||||||
end block
|
end block
|
||||||
end subroutine
|
end subroutine
|
||||||
pure subroutine s07(p) ! C1590
|
pure subroutine s07(p) ! C1590
|
||||||
!ERROR: A dummy procedure of a PURE subprogram must be PURE.
|
!ERROR: A dummy procedure of a PURE subprogram must be PURE
|
||||||
procedure(impure) :: p
|
procedure(impure) :: p
|
||||||
end subroutine
|
end subroutine
|
||||||
! C1591 is tested in call11.f90.
|
! C1591 is tested in call11.f90.
|
||||||
|
@ -131,10 +131,10 @@ module m
|
||||||
contains
|
contains
|
||||||
pure subroutine pure ! ok
|
pure subroutine pure ! ok
|
||||||
end subroutine
|
end subroutine
|
||||||
!ERROR: An internal subprogram of a PURE subprogram must also be PURE.
|
!ERROR: An internal subprogram of a PURE subprogram must also be PURE
|
||||||
subroutine impure1
|
subroutine impure1
|
||||||
end subroutine
|
end subroutine
|
||||||
!ERROR: An internal subprogram of a PURE subprogram must also be PURE.
|
!ERROR: An internal subprogram of a PURE subprogram must also be PURE
|
||||||
impure subroutine impure2
|
impure subroutine impure2
|
||||||
end subroutine
|
end subroutine
|
||||||
end subroutine
|
end subroutine
|
||||||
|
@ -144,23 +144,23 @@ module m
|
||||||
end function
|
end function
|
||||||
pure subroutine s09 ! C1593
|
pure subroutine s09 ! C1593
|
||||||
real :: x
|
real :: x
|
||||||
!ERROR: A VOLATILE variable may not appear in a PURE subprogram.
|
!ERROR: A VOLATILE variable may not appear in a PURE subprogram
|
||||||
x = volatile
|
x = volatile
|
||||||
!ERROR: A VOLATILE variable may not appear in a PURE subprogram.
|
!ERROR: A VOLATILE variable may not appear in a PURE subprogram
|
||||||
x = volptr
|
x = volptr
|
||||||
end subroutine
|
end subroutine
|
||||||
! C1594 is tested in call12.f90.
|
! C1594 is tested in call12.f90.
|
||||||
pure subroutine s10 ! C1595
|
pure subroutine s10 ! C1595
|
||||||
integer :: n
|
integer :: n
|
||||||
!ERROR: Any procedure referenced in a PURE subprogram must also be PURE.
|
!ERROR: Any procedure referenced in a PURE subprogram must also be PURE
|
||||||
n = notpure(1)
|
n = notpure(1)
|
||||||
end subroutine
|
end subroutine
|
||||||
pure subroutine s11(to) ! C1596
|
pure subroutine s11(to) ! C1596
|
||||||
type(polyAlloc) :: auto, to
|
type(polyAlloc) :: auto, to
|
||||||
!ERROR: Deallocation of a polymorphic object is not permitted in a PURE subprogram.
|
!ERROR: Deallocation of a polymorphic object is not permitted in a PURE subprogram
|
||||||
to = auto
|
to = auto
|
||||||
! Implicit deallocation at the end of the subroutine:
|
! Implicit deallocation at the end of the subroutine:
|
||||||
!ERROR: Deallocation of a polymorphic object is not permitted in a PURE subprogram.
|
!ERROR: Deallocation of a polymorphic object is not permitted in a PURE subprogram
|
||||||
end subroutine
|
end subroutine
|
||||||
pure subroutine s12
|
pure subroutine s12
|
||||||
character(20) :: buff
|
character(20) :: buff
|
||||||
|
@ -195,7 +195,7 @@ module m
|
||||||
write(*, *) ! C1598
|
write(*, *) ! C1598
|
||||||
end subroutine
|
end subroutine
|
||||||
pure subroutine s13
|
pure subroutine s13
|
||||||
!ERROR: An image control statement is not allowed in a PURE subprogram.
|
!ERROR: An image control statement is not allowed in a PURE subprogram
|
||||||
sync all ! C1599
|
sync all ! C1599
|
||||||
! TODO others from 11.6.1 (many)
|
! TODO others from 11.6.1 (many)
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
|
@ -39,10 +39,10 @@ module m
|
||||||
|
|
||||||
subroutine test
|
subroutine test
|
||||||
real :: a(pure(1)) ! ok
|
real :: a(pure(1)) ! ok
|
||||||
!ERROR: A function referenced in a specification expression must be PURE.
|
!ERROR: A function referenced in a specification expression must be PURE
|
||||||
real :: b(impure(1)) ! 10.1.11(4)
|
real :: b(impure(1)) ! 10.1.11(4)
|
||||||
forall (j=1:1)
|
forall (j=1:1)
|
||||||
!ERROR: A procedure referenced in a FORALL body must be PURE.
|
!ERROR: A procedure referenced in a FORALL body must be PURE
|
||||||
a(j) = impure(j) ! C1037
|
a(j) = impure(j) ! C1037
|
||||||
end forall
|
end forall
|
||||||
!ERROR: concurrent-header mask expression cannot reference an impure procedure
|
!ERROR: concurrent-header mask expression cannot reference an impure procedure
|
||||||
|
|
|
@ -25,7 +25,7 @@ module m
|
||||||
end type
|
end type
|
||||||
contains
|
contains
|
||||||
pure subroutine msubr
|
pure subroutine msubr
|
||||||
!ERROR: A PURE subprogram must not define a host-associated object.
|
!ERROR: A PURE subprogram must not define a host-associated object
|
||||||
x%a = 0.
|
x%a = 0.
|
||||||
end subroutine
|
end subroutine
|
||||||
end module
|
end module
|
||||||
|
@ -40,23 +40,23 @@ pure function test(ptr, in)
|
||||||
type(hasPtr), allocatable :: alloc
|
type(hasPtr), allocatable :: alloc
|
||||||
integer :: n
|
integer :: n
|
||||||
common /block/ y
|
common /block/ y
|
||||||
!ERROR: A PURE subprogram must not define an object in COMMON.
|
!ERROR: A PURE subprogram must not define an object in COMMON
|
||||||
y%a = 0. ! C1594(1)
|
y%a = 0. ! C1594(1)
|
||||||
!ERROR: A PURE subprogram must not define a USE-associated object.
|
!ERROR: A PURE subprogram must not define a USE-associated object
|
||||||
x%a = 0. ! C1594(1)
|
x%a = 0. ! C1594(1)
|
||||||
!ERROR: A PURE function must not define a pointer dummy argument.
|
!ERROR: A PURE function must not define a pointer dummy argument
|
||||||
ptr%a = 0. ! C1594(1)
|
ptr%a = 0. ! C1594(1)
|
||||||
!ERROR: A PURE subprogram must not define an INTENT(IN) dummy argument.
|
!ERROR: A PURE subprogram must not define an INTENT(IN) dummy argument
|
||||||
in%a = 0. ! C1594(1)
|
in%a = 0. ! C1594(1)
|
||||||
!ERROR: A PURE subprogram must not define a coindexed object.
|
!ERROR: A PURE subprogram must not define a coindexed object
|
||||||
co[1]%a = 0. ! C1594(1)
|
co[1]%a = 0. ! C1594(1)
|
||||||
!ERROR: A PURE function must not define a pointer dummy argument.
|
!ERROR: A PURE function must not define a pointer dummy argument
|
||||||
ptr => y ! C1594(2)
|
ptr => y ! C1594(2)
|
||||||
!ERROR: A PURE subprogram must not define a pointer dummy argument.
|
!ERROR: A PURE subprogram must not define a pointer dummy argument
|
||||||
nullify(ptr) ! C1594(2), 19.6.8
|
nullify(ptr) ! C1594(2), 19.6.8
|
||||||
!ERROR: A PURE subprogram must not use a pointer dummy argument as the target of pointer assignment.
|
!ERROR: A PURE subprogram must not use a pointer dummy argument as the target of pointer assignment
|
||||||
ptr2 => ptr ! C1594(3)
|
ptr2 => ptr ! C1594(3)
|
||||||
!ERROR: A PURE subprogram must not use an INTENT(IN) dummy argument as the target of pointer assignment.
|
!ERROR: A PURE subprogram must not use an INTENT(IN) dummy argument as the target of pointer assignment
|
||||||
ptr2 => in ! C1594(3)
|
ptr2 => in ! C1594(3)
|
||||||
!ERROR: Externally visible object 'block' must not be associated with pointer component 'p' in a PURE procedure
|
!ERROR: Externally visible object 'block' must not be associated with pointer component 'p' in a PURE procedure
|
||||||
n = size([hasPtr(y%a)]) ! C1594(4)
|
n = size([hasPtr(y%a)]) ! C1594(4)
|
||||||
|
@ -64,15 +64,15 @@ pure function test(ptr, in)
|
||||||
n = size([hasPtr(x%a)]) ! C1594(4)
|
n = size([hasPtr(x%a)]) ! C1594(4)
|
||||||
!ERROR: Externally visible object 'ptr' must not be associated with pointer component 'p' in a PURE procedure
|
!ERROR: Externally visible object 'ptr' must not be associated with pointer component 'p' in a PURE procedure
|
||||||
n = size([hasPtr(ptr%a)]) ! C1594(4)
|
n = size([hasPtr(ptr%a)]) ! C1594(4)
|
||||||
!ERROR: A PURE subprogram must not use an INTENT(IN) dummy argument as the target of pointer assignment.
|
!ERROR: A PURE subprogram must not use an INTENT(IN) dummy argument as the target of pointer assignment
|
||||||
n = size([hasPtr(in%a)]) ! C1594(4)
|
n = size([hasPtr(in%a)]) ! C1594(4)
|
||||||
!ERROR: A PURE subprogram must not assign to a variable with a POINTER component.
|
!ERROR: A PURE subprogram must not assign to a variable with a POINTER component
|
||||||
hp = hp ! C1594(5)
|
hp = hp ! C1594(5)
|
||||||
!ERROR: A PURE subprogram must not use a derived type with a POINTER component as a SOURCE=.
|
!ERROR: A PURE subprogram must not use a derived type with a POINTER component as a SOURCE=
|
||||||
allocate(alloc, source=hp)
|
allocate(alloc, source=hp)
|
||||||
contains
|
contains
|
||||||
pure subroutine internal
|
pure subroutine internal
|
||||||
!ERROR: A PURE subprogram must not define a host-associated object.
|
!ERROR: A PURE subprogram must not define a host-associated object
|
||||||
z%a = 0.
|
z%a = 0.
|
||||||
!ERROR: Externally visible object 'z' must not be associated with pointer component 'p' in a PURE procedure
|
!ERROR: Externally visible object 'z' must not be associated with pointer component 'p' in a PURE procedure
|
||||||
hp = hasPtr(z%a)
|
hp = hasPtr(z%a)
|
||||||
|
|
|
@ -29,12 +29,12 @@ module m1
|
||||||
type(dt) :: dtinst
|
type(dt) :: dtinst
|
||||||
mypp => boring ! legal
|
mypp => boring ! legal
|
||||||
mypp => (boring) ! legal, not a function reference
|
mypp => (boring) ! legal, not a function reference
|
||||||
!ERROR: A function reference that returns a procedure pointer may not be parenthesized.
|
!ERROR: A function reference that returns a procedure pointer may not be parenthesized
|
||||||
mypp => (frpp()) ! C1003
|
mypp => (frpp()) ! C1003
|
||||||
mypp => frpp() ! legal, not parenthesized
|
mypp => frpp() ! legal, not parenthesized
|
||||||
dtinst%pp => frpp
|
dtinst%pp => frpp
|
||||||
mypp => dtinst%pp() ! legal
|
mypp => dtinst%pp() ! legal
|
||||||
!ERROR: A function reference that returns a procedure pointer may not be parenthesized.
|
!ERROR: A function reference that returns a procedure pointer may not be parenthesized
|
||||||
mypp => (dtinst%pp())
|
mypp => (dtinst%pp())
|
||||||
end subroutine tests
|
end subroutine tests
|
||||||
end module m1
|
end module m1
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
N = 1024
|
N = 1024
|
||||||
!$omp do
|
!$omp do
|
||||||
do i = 1, N
|
do i = 1, N
|
||||||
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region.
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
||||||
!$omp do
|
!$omp do
|
||||||
do i = 1, N
|
do i = 1, N
|
||||||
a = 3.14
|
a = 3.14
|
||||||
|
|
|
@ -26,7 +26,7 @@ module m2
|
||||||
end type
|
end type
|
||||||
interface
|
interface
|
||||||
subroutine s
|
subroutine s
|
||||||
!ERROR: Module 'm2' cannot USE itself.
|
!ERROR: Module 'm2' cannot USE itself
|
||||||
use m2, only: t
|
use m2, only: t
|
||||||
end subroutine
|
end subroutine
|
||||||
end interface
|
end interface
|
||||||
|
|
Loading…
Reference in New Issue