[flang-commits] [flang] [llvm] [flang] Enumeration Type: (PR 3/5) Intrinsics + I/O + Modules (PR #193235)
via flang-commits
flang-commits at lists.llvm.org
Mon Aug 3 13:54:13 PDT 2026
================
@@ -1289,6 +1428,31 @@ void IoChecker::CheckNamelist(const Symbol &namelist, common::DefinedIo which,
const auto &details{namelist.GetUltimate().get<NamelistDetails>()};
for (const Symbol &object : details.objects()) {
context_.CheckIndexVarRedefine(namelistLocation, object);
+ if (auto type{evaluate::DynamicType::From(object)};
+ type && type->category() == TypeCategory::Derived) {
+ const auto &derived{type->GetDerivedTypeSpec()};
+ if (const auto *dtDetails{
+ derived.typeSymbol().detailsIf<DerivedTypeDetails>()}) {
+ if (dtDetails->isEnumerationType()) {
+ context_.Say(namelistLocation,
+ "Enumeration type '%s' may not be a namelist group object"_err_en_US,
+ derived.name());
+ continue;
+ }
+ }
+ // A namelist group object of derived type that is not processed by
+ // defined I/O expands into its components (F2023 12.6.3), so reject one
+ // that reaches an enumeration effective item.
+ const Scope &scope{context_.FindScope(namelistLocation)};
+ if (!HasDefinedIo(which, derived, &scope)) {
+ if (const Symbol *bad{
+ FindEnumerationTypeComponent(which, derived, scope)}) {
+ context_.Say(namelistLocation,
----------------
kwyatt-ext wrote:
If I have the lines correctly, the check above that is the direct test of C8019. I have removed that check and placed one in the declaration.
https://github.com/llvm/llvm-project/pull/193235
More information about the flang-commits
mailing list