[flang][semantics] Reject DATA-style initializer on EXTERNAL/INTRINSIC (#222256) An `entity-decl` carrying a legacy `/initialization/` (an extension) was silently accepted, and the initializer dropped, when the name had already been declared `EXTERNAL` or `INTRINSIC`: ```fortran subroutine s external foo integer foo /1/ ! accepted, no initialization emitted end subroutine ``` `DataChecker::Leave(const parser::EntityDecl &)` passed the value list to `AccumulateDataInitializations` without checking the symbol's class, so the initialization never reached the emitted code and no diagnostic was produced. Reversing the two statements already errors, so the behaviour was also order-dependent. For an intrinsic name that is not an unrestricted specific function (`sum`), the accumulated value instead tripped `CHECK(designator.has_value())` in `data-to-inits.cpp` and crashed the compiler. A procedure name is not a data-stmt-object (F2023 C880, R842), so reject it here. Procedure pointer initialization is an accepted extension (8.6.7), so `IsProcedurePointer` symbols still take the existing path. Fixes #222168 Assisted-by: Qoder (AI assistant)
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.