@@ -121,30 +121,29 @@ class CheckHelper {
121
121
void CheckBindCFunctionResult (const Symbol &);
122
122
// Check functions for defined I/O procedures
123
123
void CheckDefinedIoProc (
124
- const Symbol &, const GenericDetails &, GenericKind ::DefinedIo);
124
+ const Symbol &, const GenericDetails &, common ::DefinedIo);
125
125
bool CheckDioDummyIsData (const Symbol &, const Symbol *, std::size_t );
126
- void CheckDioDummyIsDerived (const Symbol &, const Symbol &,
127
- GenericKind ::DefinedIo ioKind, const Symbol &);
126
+ void CheckDioDummyIsDerived (
127
+ const Symbol &, const Symbol &, common ::DefinedIo ioKind, const Symbol &);
128
128
void CheckDioDummyIsDefaultInteger (const Symbol &, const Symbol &);
129
129
void CheckDioDummyIsScalar (const Symbol &, const Symbol &);
130
130
void CheckDioDummyAttrs (const Symbol &, const Symbol &, Attr);
131
131
void CheckDioDtvArg (
132
- const Symbol &, const Symbol *, GenericKind ::DefinedIo, const Symbol &);
132
+ const Symbol &, const Symbol *, common ::DefinedIo, const Symbol &);
133
133
void CheckGenericVsIntrinsic (const Symbol &, const GenericDetails &);
134
134
void CheckDefaultIntegerArg (const Symbol &, const Symbol *, Attr);
135
135
void CheckDioAssumedLenCharacterArg (
136
136
const Symbol &, const Symbol *, std::size_t , Attr);
137
137
void CheckDioVlistArg (const Symbol &, const Symbol *, std::size_t );
138
- void CheckDioArgCount (
139
- const Symbol &, GenericKind::DefinedIo ioKind, std::size_t );
138
+ void CheckDioArgCount (const Symbol &, common::DefinedIo ioKind, std::size_t );
140
139
struct TypeWithDefinedIo {
141
140
const DerivedTypeSpec &type;
142
- GenericKind ::DefinedIo ioKind;
141
+ common ::DefinedIo ioKind;
143
142
const Symbol &proc;
144
143
const Symbol &generic;
145
144
};
146
- void CheckAlreadySeenDefinedIo (const DerivedTypeSpec &,
147
- GenericKind::DefinedIo, const Symbol &, const Symbol &generic);
145
+ void CheckAlreadySeenDefinedIo (const DerivedTypeSpec &, common::DefinedIo,
146
+ const Symbol &, const Symbol &generic);
148
147
void CheckModuleProcedureDef (const Symbol &);
149
148
150
149
SemanticsContext &context_;
@@ -1426,7 +1425,7 @@ void CheckHelper::CheckGeneric(
1426
1425
const Symbol &symbol, const GenericDetails &details) {
1427
1426
CheckSpecifics (symbol, details);
1428
1427
common::visit (common::visitors{
1429
- [&](const GenericKind ::DefinedIo &io) {
1428
+ [&](const common ::DefinedIo &io) {
1430
1429
CheckDefinedIoProc (symbol, details, io);
1431
1430
},
1432
1431
[&](const GenericKind::OtherKind &other) {
@@ -2498,13 +2497,13 @@ bool CheckHelper::CheckDioDummyIsData(
2498
2497
}
2499
2498
2500
2499
void CheckHelper::CheckAlreadySeenDefinedIo (const DerivedTypeSpec &derivedType,
2501
- GenericKind ::DefinedIo ioKind, const Symbol &proc, const Symbol &generic) {
2502
- // Check for conflict between non-type-bound UDDTIO and type-bound generics.
2503
- // It's okay to have two or more distinct derived type I/O procedures
2504
- // for the same type if they're coming from distinct non-type-bound
2505
- // interfaces. (The non-type-bound interfaces would have been merged into
2506
- // a single generic -- with errors where indistinguishable -- if both were
2507
- // visible in the same scope.)
2500
+ common ::DefinedIo ioKind, const Symbol &proc, const Symbol &generic) {
2501
+ // Check for conflict between non-type-bound defined I/O and type-bound
2502
+ // generics. It's okay to have two or more distinct defined I/O procedures for
2503
+ // the same type if they're coming from distinct non-type-bound interfaces.
2504
+ // (The non-type-bound interfaces would have been merged into a single generic
2505
+ // -- with errors where indistinguishable -- when both were visible from the
2506
+ // same scope.)
2508
2507
if (generic.owner ().IsDerivedType ()) {
2509
2508
return ;
2510
2509
}
@@ -2528,7 +2527,7 @@ void CheckHelper::CheckAlreadySeenDefinedIo(const DerivedTypeSpec &derivedType,
2528
2527
}
2529
2528
2530
2529
void CheckHelper::CheckDioDummyIsDerived (const Symbol &subp, const Symbol &arg,
2531
- GenericKind ::DefinedIo ioKind, const Symbol &generic) {
2530
+ common ::DefinedIo ioKind, const Symbol &generic) {
2532
2531
if (const DeclTypeSpec *type{arg.GetType ()}) {
2533
2532
if (const DerivedTypeSpec *derivedType{type->AsDerived ()}) {
2534
2533
CheckAlreadySeenDefinedIo (*derivedType, ioKind, subp, generic);
@@ -2573,13 +2572,13 @@ void CheckHelper::CheckDioDummyIsScalar(const Symbol &subp, const Symbol &arg) {
2573
2572
}
2574
2573
2575
2574
void CheckHelper::CheckDioDtvArg (const Symbol &subp, const Symbol *arg,
2576
- GenericKind ::DefinedIo ioKind, const Symbol &generic) {
2575
+ common ::DefinedIo ioKind, const Symbol &generic) {
2577
2576
// Dtv argument looks like: dtv-type-spec, INTENT(INOUT) :: dtv
2578
2577
if (CheckDioDummyIsData (subp, arg, 0 )) {
2579
2578
CheckDioDummyIsDerived (subp, *arg, ioKind, generic);
2580
2579
CheckDioDummyAttrs (subp, *arg,
2581
- ioKind == GenericKind ::DefinedIo::ReadFormatted ||
2582
- ioKind == GenericKind ::DefinedIo::ReadUnformatted
2580
+ ioKind == common ::DefinedIo::ReadFormatted ||
2581
+ ioKind == common ::DefinedIo::ReadUnformatted
2583
2582
? Attr::INTENT_INOUT
2584
2583
: Attr::INTENT_IN);
2585
2584
}
@@ -2668,10 +2667,10 @@ void CheckHelper::CheckDioVlistArg(
2668
2667
}
2669
2668
2670
2669
void CheckHelper::CheckDioArgCount (
2671
- const Symbol &subp, GenericKind ::DefinedIo ioKind, std::size_t argCount) {
2670
+ const Symbol &subp, common ::DefinedIo ioKind, std::size_t argCount) {
2672
2671
const std::size_t requiredArgCount{
2673
- (std::size_t )(ioKind == GenericKind ::DefinedIo::ReadFormatted ||
2674
- ioKind == GenericKind ::DefinedIo::WriteFormatted
2672
+ (std::size_t )(ioKind == common ::DefinedIo::ReadFormatted ||
2673
+ ioKind == common ::DefinedIo::WriteFormatted
2675
2674
? 6
2676
2675
: 4 )};
2677
2676
if (argCount != requiredArgCount) {
@@ -2704,7 +2703,7 @@ void CheckHelper::CheckDioDummyAttrs(
2704
2703
2705
2704
// Enforce semantics for defined input/output procedures (12.6.4.8.2) and C777
2706
2705
void CheckHelper::CheckDefinedIoProc (const Symbol &symbol,
2707
- const GenericDetails &details, GenericKind ::DefinedIo ioKind) {
2706
+ const GenericDetails &details, common ::DefinedIo ioKind) {
2708
2707
for (auto ref : details.specificProcs ()) {
2709
2708
const Symbol &ultimate{ref->GetUltimate ()};
2710
2709
const auto *binding{ultimate.detailsIf <ProcBindingDetails>()};
@@ -2730,8 +2729,8 @@ void CheckHelper::CheckDefinedIoProc(const Symbol &symbol,
2730
2729
CheckDefaultIntegerArg (specific, arg, Attr::INTENT_IN);
2731
2730
break ;
2732
2731
case 2 :
2733
- if (ioKind == GenericKind ::DefinedIo::ReadFormatted ||
2734
- ioKind == GenericKind ::DefinedIo::WriteFormatted) {
2732
+ if (ioKind == common ::DefinedIo::ReadFormatted ||
2733
+ ioKind == common ::DefinedIo::WriteFormatted) {
2735
2734
// CHARACTER (LEN=*), INTENT(IN) :: iotype
2736
2735
CheckDioAssumedLenCharacterArg (
2737
2736
specific, arg, argCount, Attr::INTENT_IN);
@@ -2741,8 +2740,8 @@ void CheckHelper::CheckDefinedIoProc(const Symbol &symbol,
2741
2740
}
2742
2741
break ;
2743
2742
case 3 :
2744
- if (ioKind == GenericKind ::DefinedIo::ReadFormatted ||
2745
- ioKind == GenericKind ::DefinedIo::WriteFormatted) {
2743
+ if (ioKind == common ::DefinedIo::ReadFormatted ||
2744
+ ioKind == common ::DefinedIo::WriteFormatted) {
2746
2745
// INTEGER, INTENT(IN) :: v_list(:)
2747
2746
CheckDioVlistArg (specific, arg, argCount);
2748
2747
} else {
0 commit comments