[flang-commits] [flang] [Flang] Handle ambiguous types in generic interfaces (PR #221861)

via flang-commits flang-commits at lists.llvm.org
Mon Sep 7 18:34:40 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- flang/lib/Semantics/resolve-names.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index a7ca981b6..5cd164c4d 100644
--- a/flang/lib/Semantics/resolve-names.cpp
+++ b/flang/lib/Semantics/resolve-names.cpp
@@ -5109,12 +5109,12 @@ void InterfaceVisitor::CheckGenericProcedures(Symbol &generic) {
       subroutine = &specific;
       // A generic can retain an ambiguous homonymous derived type as a
       // UseErrorDetails symbol.  It is not a derived type for this warning.
-      if (const Symbol * derivedType{details.derivedType()}; derivedType &&
+      if (const Symbol *derivedType{details.derivedType()}; derivedType &&
           derivedType->GetUltimate().has<DerivedTypeDetails>() &&
           context().ShouldWarn(
               common::LanguageFeature::SubroutineAndFunctionSpecifics) &&
           !InModuleFile()) {
-        if (const Scope * typeScope{derivedType->GetUltimate().scope()}) {
+        if (const Scope *typeScope{derivedType->GetUltimate().scope()}) {
           SayDerivedType(generic.name(),
               "Generic interface '%s' should only contain functions due to derived type with same name"_warn_en_US,
               *typeScope)

``````````

</details>


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


More information about the flang-commits mailing list