[flang-commits] [flang] Fix #222168: reject DATA-style initializer on EXTERNAL/INTRINSIC (PR #222256)

Adarsh Mishra via flang-commits flang-commits at lists.llvm.org
Tue Sep 22 07:28:35 PDT 2026


================

----------------
Adarsh-Me wrote:

Done in 5c3d2c83c. `flang/test/Semantics/data28.f90` is now your six cases, kept verbatim including the comments, so the file covers:

- `s1` an `EXTERNAL` procedure name,
- `s2` an unrestricted specific intrinsic (`sin`),
- `s3` an intrinsic that is **not** an unrestricted specific function (`sum`), which is the shape that used to reach `AccumulateDataInitializations` and trip `CHECK(designator.has_value())` in `data-to-inits.cpp`,
- `s4` a dummy procedure,
- `s5` a plain local object that merely shares a name with an intrinsic, which must stay accepted because the guard keys on symbol class and not on the name,
- `s6` procedure pointer initialization, which must stay accepted as the extension in 8.6.7.

`s5` and `s6` are the two that would regress if the predicate were name-based or if `IsProcedure` were used without the `IsProcedurePointer` exclusion, so they are the cases I most wanted in the file.

The honest gap: only the original two cases have been through a green premerge (on head 02d68ab35, Build and Test Linux/Windows/AArch64 all passed). `test_errors.py` diffs the complete diagnostic set, so an extra message anywhere in a subroutine fails the run even when the expected `!ERROR` line is present. s4 is the one I am least sure of, since a dummy procedure that is also given a type and an initializer could plausibly be rejected by another checker as well. I will push a fixup as soon as the run on this head reports.

https://github.com/llvm/llvm-project/pull/222256


More information about the flang-commits mailing list