[flang-commits] [flang] [flang] Fixed regression with CDEFINED linkage (PR #164616)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Wed Oct 22 11:19:00 PDT 2025
================
@@ -9194,11 +9194,12 @@ bool DeclarationVisitor::CheckNonPointerInitialization(
"'%s' has already been initialized"_err_en_US);
} else if (IsAllocatable(ultimate)) {
Say(name, "Allocatable object '%s' cannot be initialized"_err_en_US);
+ } else if (details->isCDefined()) {
+ // CDEFINED variables cannot have initializer, because their storage
+ // may come outside of Fortran.
+ context().Warn(common::UsageWarning::CdefinedInit, name.source,
----------------
eugeneepshteyn wrote:
Done.
https://github.com/llvm/llvm-project/pull/164616
More information about the flang-commits
mailing list