[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:
peter klausler 2019-09-13 13:57:35 -07:00
parent 9c3a9375be
commit 1c10d963aa
15 changed files with 86 additions and 86 deletions

View File

@ -30,24 +30,24 @@ static void CheckSymbol(SemanticsContext &context, const Symbol &symbol) {
if (IsAssumedLengthCharacterFunction(symbol)) { // C723
if (symbol.attrs().test(Attr::RECURSIVE)) {
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) {
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)) {
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)) {
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 (result->attrs().test(Attr::POINTER)) {
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);
}
}
}

View File

@ -84,7 +84,7 @@ bool OmpStructureChecker::HasInvalidWorksharingNesting(
context_.Say(source,
"A worksharing region may not be closely nested inside a "
"worksharing, explicit task, taskloop, critical, ordered, atomic, or "
"master region."_err_en_US);
"master region"_err_en_US);
return true;
}
return false;

View File

@ -1501,7 +1501,7 @@ auto ExpressionAnalyzer::Procedure(const parser::ProcedureDesignator &pd,
if (symbol.attrs().test(
semantics::Attr::NON_RECURSIVE)) { // 15.6.2.1(3)
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)}) {
msg->Attach(
symbol.name(), "definition of '%s'"_en_US, n.source);
@ -1509,7 +1509,7 @@ auto ExpressionAnalyzer::Procedure(const parser::ProcedureDesignator &pd,
} else if (IsAssumedLengthCharacterFunction(
symbol)) { // 15.6.2.1(3)
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)}) {
msg->Attach(
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) &&
proc->IsElemental()) { // C1533
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)}) {
@ -1578,7 +1578,7 @@ std::optional<ActualArgument> ExpressionAnalyzer::AnalyzeActualArgument(
if (const semantics::DerivedTypeSpec * derived{type->AsDerived()}) {
if (auto ptr{semantics::FindPointerUltimateComponent(*derived)}) {
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())}) {
msg->Attach((*ptr)->name(),
"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 (semantics::IsProcedurePointer(*result)) {
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
}
}
}

View File

@ -2100,7 +2100,7 @@ Scope *ModuleVisitor::FindModule(const parser::Name &name, Scope *ancestor) {
return nullptr;
}
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());
return scope;

View File

@ -20,7 +20,7 @@ non_recursive function f01(n) result(res)
if (n <= 0) then
res = n
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)
end if
end function
@ -35,68 +35,68 @@ non_recursive function f02(n) result(res)
end if
contains
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)
end function nested
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
integer, value :: n
f03 = ''
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
integer, value :: n
character(*) :: res
res = ''
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()
dimension :: f05(1) ! C723
f05(1) = ''
end function
!ERROR: An assumed-length CHARACTER(*) function cannot return an array.
!ERROR: An assumed-length CHARACTER(*) function cannot return an array
function f06()
character(*) :: f06(1) ! C723
f06(1) = ''
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()
pointer :: f07 ! C723
character, target :: a = ' '
f07 => a
end function
!ERROR: An assumed-length CHARACTER(*) function cannot return a POINTER.
!ERROR: An assumed-length CHARACTER(*) function cannot return a POINTER
function f08()
character(*), pointer :: f08 ! C723
character, target :: a = ' '
f08 => a
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
f09 = ''
end function
!ERROR: An assumed-length CHARACTER(*) function cannot be PURE.
!ERROR: An assumed-length CHARACTER(*) function cannot be PURE
pure function f10()
character(*) :: f10 ! C723
f10 = ''
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
integer, value :: n
f11 = ''
end function
!ERROR: An assumed-length CHARACTER(*) function cannot be ELEMENTAL.
!ERROR: An assumed-length CHARACTER(*) function cannot be ELEMENTAL
elemental function f12(n)
character(*) :: f12 ! C723
integer, value :: n
@ -109,7 +109,7 @@ function f13(n) result(res)
if (n <= 0) then
res = ''
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)
end if
end function
@ -124,7 +124,7 @@ function f14(n) result(res)
end if
contains
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)
end function nested
end function

View File

@ -27,7 +27,7 @@ subroutine s01(elem, subr)
end subroutine
end interface
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
end subroutine
@ -47,13 +47,13 @@ module m01
end function
subroutine test
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
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument.
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument
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
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument.
!ERROR: Non-intrinsic ELEMENTAL procedure cannot be passed as argument
call callme(elem04) ! C1533
contains
elemental real function elem04(x)
@ -72,7 +72,7 @@ module m02
type(t), intent(in) :: x
end subroutine
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
end subroutine
end module

View File

@ -35,27 +35,27 @@ module m
real, allocatable, intent(out) :: x(:)
end subroutine
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)
end subroutine
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
end subroutine
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
end subroutine
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
end subroutine
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
end subroutine
@ -63,12 +63,12 @@ end module
subroutine s06(x) ! C847
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
end subroutine
subroutine s07(x) ! C847
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
end subroutine

View File

@ -76,41 +76,41 @@ module m
call sma(ma) ! ok
call spp(pp) ! 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)
!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)
!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)
!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)
!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)
!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)
!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)
!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)
!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)
!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)
!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)
!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 sdmp(dmp) ! ok
call sdma(dma) ! ok
call snmp(nmp) ! 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)
!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)
!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)
!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)
end subroutine

View File

@ -61,9 +61,9 @@ module m
call s04(cov[1]) ! ok
!ERROR: Coindexed ALLOCATABLE effective argument must be associated with INTENT(IN) dummy argument
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)
!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)
end subroutine
end module

View File

@ -123,7 +123,7 @@ module m
end block
end subroutine
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
end subroutine
! C1591 is tested in call11.f90.
@ -131,10 +131,10 @@ module m
contains
pure subroutine pure ! ok
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
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
end subroutine
end subroutine
@ -144,23 +144,23 @@ module m
end function
pure subroutine s09 ! C1593
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
!ERROR: A VOLATILE variable may not appear in a PURE subprogram.
!ERROR: A VOLATILE variable may not appear in a PURE subprogram
x = volptr
end subroutine
! C1594 is tested in call12.f90.
pure subroutine s10 ! C1595
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)
end subroutine
pure subroutine s11(to) ! C1596
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
! 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
pure subroutine s12
character(20) :: buff
@ -195,7 +195,7 @@ module m
write(*, *) ! C1598
end subroutine
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
! TODO others from 11.6.1 (many)
end subroutine

View File

@ -39,10 +39,10 @@ module m
subroutine test
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)
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
end forall
!ERROR: concurrent-header mask expression cannot reference an impure procedure

View File

@ -25,7 +25,7 @@ module m
end type
contains
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.
end subroutine
end module
@ -40,23 +40,23 @@ pure function test(ptr, in)
type(hasPtr), allocatable :: alloc
integer :: n
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)
!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)
!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)
!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)
!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)
!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)
!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
!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)
!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)
!ERROR: Externally visible object 'block' must not be associated with pointer component 'p' in a PURE procedure
n = size([hasPtr(y%a)]) ! C1594(4)
@ -64,15 +64,15 @@ pure function test(ptr, in)
n = size([hasPtr(x%a)]) ! C1594(4)
!ERROR: Externally visible object 'ptr' must not be associated with pointer component 'p' in a PURE procedure
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)
!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)
!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)
contains
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.
!ERROR: Externally visible object 'z' must not be associated with pointer component 'p' in a PURE procedure
hp = hasPtr(z%a)

View File

@ -29,12 +29,12 @@ module m1
type(dt) :: dtinst
mypp => boring ! legal
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() ! legal, not parenthesized
dtinst%pp => frpp
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())
end subroutine tests
end module m1

View File

@ -19,7 +19,7 @@
N = 1024
!$omp do
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
do i = 1, N
a = 3.14

View File

@ -26,7 +26,7 @@ module m2
end type
interface
subroutine s
!ERROR: Module 'm2' cannot USE itself.
!ERROR: Module 'm2' cannot USE itself
use m2, only: t
end subroutine
end interface