forked from OSchip/llvm-project
[flang] Response to Steve Scalpone's suggestion to improve a message
Summary: I updated the code that produces the message and the associated test. Reviewers: sscalpone, DavidTruby, kiranchandramohan Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79514
This commit is contained in:
parent
16c800b8b7
commit
07b69dcf66
|
@ -207,7 +207,7 @@ public:
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
} else if (scope_.IsDerivedType() && IsVariableName(symbol) &&
|
} else if (scope_.IsDerivedType() && IsVariableName(symbol) &&
|
||||||
specExprContext_ == SpecificationExprContext::BOUND) { // C750
|
specExprContext_ == SpecificationExprContext::BOUND) { // C750
|
||||||
return "derived type component not allowed to reference to variable '"s +
|
return "derived type component not allowed to reference variable '"s +
|
||||||
symbol.name().ToString() + "'";
|
symbol.name().ToString() + "'";
|
||||||
} else if (symbol.IsDummy()) {
|
} else if (symbol.IsDummy()) {
|
||||||
if (symbol.attrs().test(semantics::Attr::OPTIONAL)) {
|
if (symbol.attrs().test(semantics::Attr::OPTIONAL)) {
|
||||||
|
|
|
@ -58,7 +58,7 @@ subroutine s(iArg, allocArg, pointerArg, arrayArg, ioArg, optionalArg)
|
||||||
real, dimension(iabs(iArg)) :: arrayVarWithIntrinsic
|
real, dimension(iabs(iArg)) :: arrayVarWithIntrinsic
|
||||||
|
|
||||||
type arrayType
|
type arrayType
|
||||||
!ERROR: Invalid specification expression: derived type component not allowed to reference to variable 'var'
|
!ERROR: Invalid specification expression: derived type component not allowed to reference variable 'var'
|
||||||
real, dimension(var) :: varField
|
real, dimension(var) :: varField
|
||||||
!ERROR: Invalid specification expression: reference to impure function 'ivolatilestmtfunc'
|
!ERROR: Invalid specification expression: reference to impure function 'ivolatilestmtfunc'
|
||||||
real, dimension(iVolatileStmtFunc()) :: arrayFieldWithVolatile
|
real, dimension(iVolatileStmtFunc()) :: arrayFieldWithVolatile
|
||||||
|
@ -66,7 +66,7 @@ subroutine s(iArg, allocArg, pointerArg, arrayArg, ioArg, optionalArg)
|
||||||
real, dimension(iImpureStmtFunc()) :: arrayFieldWithImpureFunction
|
real, dimension(iImpureStmtFunc()) :: arrayFieldWithImpureFunction
|
||||||
!ERROR: Invalid specification expression: reference to statement function 'ipurestmtfunc'
|
!ERROR: Invalid specification expression: reference to statement function 'ipurestmtfunc'
|
||||||
real, dimension(iPureStmtFunc()) :: arrayFieldWithPureFunction
|
real, dimension(iPureStmtFunc()) :: arrayFieldWithPureFunction
|
||||||
!ERROR: Invalid specification expression: derived type component not allowed to reference to variable 'iarg'
|
!ERROR: Invalid specification expression: derived type component not allowed to reference variable 'iarg'
|
||||||
real, dimension(iabs(iArg)) :: arrayFieldWithIntrinsic
|
real, dimension(iabs(iArg)) :: arrayFieldWithIntrinsic
|
||||||
!ERROR: Invalid specification expression: reference to intrinsic 'allocated' not allowed for derived type components
|
!ERROR: Invalid specification expression: reference to intrinsic 'allocated' not allowed for derived type components
|
||||||
real, dimension(merge(1, 2, allocated(allocArg))) :: realField1
|
real, dimension(merge(1, 2, allocated(allocArg))) :: realField1
|
||||||
|
@ -74,7 +74,7 @@ subroutine s(iArg, allocArg, pointerArg, arrayArg, ioArg, optionalArg)
|
||||||
real, dimension(merge(1, 2, associated(pointerArg))) :: realField2
|
real, dimension(merge(1, 2, associated(pointerArg))) :: realField2
|
||||||
!ERROR: Invalid specification expression: non-constant reference to inquiry intrinsic 'is_contiguous' not allowed for derived type components
|
!ERROR: Invalid specification expression: non-constant reference to inquiry intrinsic 'is_contiguous' not allowed for derived type components
|
||||||
real, dimension(merge(1, 2, is_contiguous(arrayArg))) :: realField3
|
real, dimension(merge(1, 2, is_contiguous(arrayArg))) :: realField3
|
||||||
!ERROR: Invalid specification expression: derived type component not allowed to reference to variable 'ioarg'
|
!ERROR: Invalid specification expression: derived type component not allowed to reference variable 'ioarg'
|
||||||
real, dimension(ioArg) :: realField4
|
real, dimension(ioArg) :: realField4
|
||||||
!ERROR: Invalid specification expression: reference to intrinsic 'present' not allowed for derived type components
|
!ERROR: Invalid specification expression: reference to intrinsic 'present' not allowed for derived type components
|
||||||
real, dimension(merge(1, 2, present(optionalArg))) :: realField5
|
real, dimension(merge(1, 2, present(optionalArg))) :: realField5
|
||||||
|
|
Loading…
Reference in New Issue