322 Commits
Author SHA1 Message Date
kwyatt-extandKevin Wyatt 5c02f7530c [flang] Enumeration Type: (PR 2/5) Name Resolution + Expression + Relational + SELECT CASE (#193028)
This PR completes the addition of enumeration types to the symbol table.
It adds core semantic analysis for ENUMERATION TYPE, name resolution,
expression analysis for constructors and relational operators, and
SELECT CASE support. Also includes a bug fix for non-constant
enumeration comparisons in Relate() (scope() → GetScope()).

It is the 2nd of 5 stacked PRs.

AI Usage Disclosure: AI tools (Claude Opus 4.6) were used to assist with
implementation of this feature and test code generation. I have
reviewed, modified, and tested all AI-generated code.

---------

Co-authored-by: Kevin Wyatt <kwyatt@hpe.com>
2026-06-30 12:24:57 -05:00
Zhen Wang b15fdf4834 [flang][cuda] Exclude non-variable actuals from unified-memory CUDA data attribute relaxation (#206121)
Under -gpu=mem:unified, the CUDA data attribute compatibility check
(AreCompatibleCUDADataAttrs) allows an unattributed actual argument to
bind to a Device/Managed/Unified dummy. This relaxation is correct for
variables whose storage is accessible from device code under unified
memory, but not for non-variable expression results (e.g. intrinsic call
results like RESHAPE(...)), which are host temporaries.

Without this fix, a generic SUM call like sum(reshape(hostArray, ...),
dim=2) could resolve to a device-specific overload instead of the
intrinsic, because the RESHAPE result was incorrectly considered
compatible with a DEVICE-attributed dummy.

This patch:

- Adds an actualIsVariable parameter to AreCompatibleCUDADataAttrs
(defaulting to true for backward compatibility) and gates the
unified-memory relaxation for Device/Managed/Unified dummies on it.
- Passes actualIsVariable from CheckExplicitDataArg in check-call.
- Stops setting actualCanUseImplicitCudaMemoryMode for non-variable
expressions in GetMatchingDistance, so the CUDA matching distance
ranking is also correct.
2026-06-26 15:41:11 -07:00
Valentin Clement (バレンタイン クレメン) 2fe6548997 [flang][cuda] Add NYI message for CUDA dynamic parallelism (#205628) 2026-06-25 04:28:45 +00:00
Zhen Wang 3b1927989a [flang][cuda] Prefer valid intrinsics over host-only generics in device code (#205376)
In CUDA device code, a host-only generic can shadow an intrinsic with
the same name and cause a valid call such as maxloc(a, 1) to be rejected
as non-device-callable. Retry intrinsic resolution for host-only generic
function calls in device context, preserving normal diagnostics when no
valid intrinsic matches.
2026-06-23 21:16:50 +00:00
Eugene Epshteyn c97eb542a7 [flang][Semantics] Do not require explicit interface checks for statement functions (#205023)
https://github.com/llvm/llvm-project/pull/198610 caused a regression,
where the
code path for explicit interface checks was also used for the statement
functions arg check. Refactor the code to avoid explicit interface
checks.

Fixes #203500

Assisted-by: AI
2026-06-22 17:35:32 -04:00
Krzysztof Parzyszek 018b29a0b0 [flang] Extract misparsed function reference check into function (#203899)
Function calls and array element acceses have the same syntax, and some
array element accesses may be misparsed as calls. The ExprChecker will
identify and correct such cases in expressions, but they may also occur
outside of expressions (e.g. OpenMP directives and clauses).

To avoid code duplication extract the check into a new function
`IsMisparsedFunctionReference`.
2026-06-15 15:51:21 -05:00
Zhen Wang af60d56719 [flang][CUDA] Keep host literals from using unified-memory generic distance (#201257)
Fix CUDA generic resolution under `-gpu=mem:unified` so unattributed
literals and expression temporaries are not treated as unified-memory
actuals.

Previously, a host scalar literal such as `1.0` could score as
compatible with a `DEVICE` dummy and incorrectly select the
device-scalar overload. This could pass a host stack address to a device
helper and fail at runtime. The fix applies the unified/managed memory
distance columns only to symbol-backed actuals.
2026-06-12 23:25:36 +00:00
jay0xandJay Satish Kumar Patel b01d0342c1 [Flang] Reject keyword arguments in statement function calls (#198610)
**Problem**
Flang silently accepted keyword arguments in calls to statement
functions, violating F2018 C1535.


**Standard: F2018 §15.5.1 C1535**: In a reference to a procedure whose
interface is implicit at the point of the reference, the actual argument
shall not be a keyword argument.

Flang silently compiles the following code without giving error` Keyword
argument 'x' at (1) is invalid in a statement function
`
```
program test
  integer :: f1, x, c
  f1(x) = x / 2
  c = f1(x=10)  ! Should be an error
end program

```

**Summary**
Fixed an issue where statement functions were incorrectly treated as
having an explicit interface, causing argument checks to be skipped.
Now, statement functions are marked correctly so existing checks run and
proper errors are shown

**Fixes** : [198523](https://github.com/llvm/llvm-project/issues/198523)

---------

Co-authored-by: Jay Satish Kumar Patel <kumarpat@pe31.hpc.amslabs.hpecorp.net>
2026-06-11 15:46:18 +05:30
Zhen Wang ad422cd10b [flang][cuda] Handle Constant and Shared attributes in CUDA generic matching distance (#201451)
The CUDA generic resolution matching distance function did not handle
actual arguments with the `Constant` or `Shared` data attribute. These
attributes represent device memory but were unhandled, causing the
distance to fall through to infinity. Under `-gpu=mem:unified`, this led
to spurious ambiguity errors when multiple specifics (e.g.
host-to-device and device-to-device overloads) both became candidates
with tied infinite distances.

Treat Constant and Shared actuals the same as Device in the matching
distance table, since all three reside in device memory.
2026-06-03 15:17:47 -07:00
Vir Patelandvirsworld c8efcf55ee [flang][PPC] Improve vector type names in expression diagnostics (NFC) (#199383)
Continuation of #197821 
The change only affects vector types; all other types preserve their
existing formatting behavior.

Co-authored-by: virsworld <virpatel@mac.home>
2026-05-27 13:43:40 -04:00
Caroline Newcombe 297678e61e Revert "[flang][PPC] Improve vector type names in expression diagnost… (#198908)
…ics (NFC…"

This reverts commit b387674b52.
2026-05-20 16:40:03 -05:00
Vir Patel b387674b52 [flang][PPC] Improve vector type names in expression diagnostics (NFC) (#197821)
Improve Flang semantic diagnostics for vector types by printing vector
type spellings in Fortran syntax instead of internal builtin-derived
type names.

Use `DerivedTypeSpec::VectorTypeAsFortran()` when producing vector
operand type names in `ArgumentAnalyzer::TypeAsFortran()`, instead of
relying on the generic type formatting path.

This updates diagnostics to print vector types as Fortran source-like
spellings, such as:
- `vector(integer(4))`
- `vector(real(4))`

while preserving the existing formatting for non-vector derived types.
2026-05-20 14:37:17 -05:00
Zhen Wang 4f60fb9a1e [flang][cuda] Honor !dir$ ignore_tkr(m) under -gpu=mem:{unified,managed} (#197518)
A device-typed dummy with `!dir$ ignore_tkr(m)` is meant to be an
overload discriminator (only selected for actuals with an explicit
`device/managed/unified` attribute). Skip the host->device relaxation in
AreCompatibleCUDADataAttrs when `IgnoreTKR::Managed` is set so
unattributed host actuals no longer bind to such a dummy.

Also document the §3.2.3 matching distance table next to
GetMatchingDistance and add LIT tests for the full Table 2 grid
and the ignore_tkr(m) carve-out.
2026-05-13 22:07:22 -07:00
Valentin Clement (バレンタイン クレメン) 483ecf89f9 [flang][cuda] Fix CUDA generic matching with omitted optional args (#197275)
Skip omitted optional arguments when computing CUDA address-space
matching distances, so -gpu=unified overload resolution does not compare
expanded dummy-argument lists of different sizes. Adds a regression
covering a unified-memory overload with optional extras.
2026-05-12 13:44:33 -07:00
Zhen Wang 5c127fba0b [flang][cuda][openacc] Reject UseDevice actual against managed/unified dummy (#196428)
After #195182 introduced the `UseDevice` attribute, a `use_device(...)`
actual was treated as compatible with **any** dummy attribute. Combined
with the matching distance returning ∞ for `UseDevice →
managed/unified`, this caused generic resolution to misreport a clean
"no match" as an **ambiguity** when only managed/unified specifics
existed.

This PR tightens `AreCompatibleCUDADataAttrs`: a `UseDevice` actual is
only compatible with a `Device` dummy or a host (no-attribute) dummy.
Other attributes (`Managed`, `Unified`, `Pinned`, ...) require their
actual to live in that specific kind of memory.
2026-05-07 19:31:43 -07:00
Valentin Clement (バレンタイン クレメン) bd62f93272 [flang][cuda] Allow CUDA variable for assumed-type dummy (#196135) 2026-05-06 11:55:45 -07:00
Zhen Wang 4a28ba60da [flang][cuda][openacc] Add UseDevice attribute to model host_data use_device symbols (#195182)
Symbols appearing in `!$acc host_data use_device(...)` were previously
marked with `CUDADataAttr::Device`, which caused generic resolution to
fail.

Introduce a new CUDADataAttr::UseDevice enumerator and use it in
`CopySymbolWithDevice` / `CloneDerivedTypeForUseDeviceImpl` instead of
Device. The new attribute is:

1. Compatible with any dummy in AreCompatibleCUDADataAttrs.
2. Ranked in the matching distance table (GetMatchingDistance): prefers
Device dummies (0), accepts Managed/Unified (2), and allows host dummies
(3).
3. Not user-spellable — only set internally during OpenACC name
resolution, never parsed from source or written to module files.
4. Treated like Device for non-host-array checks, I/O restrictions, and
MLIR lowering (mapped to `cuf::DataAttribute::Device`).
2026-05-05 18:23:47 +00:00
Vineet Kumar 6d826cb602 [flang] Add parser support for Fortran 2023 conditional arguments (F2023 R1526-R1528) (#191303)
Implement parsing, unparsing, and parse tree nodes for the Fortran 2023
conditional argument syntax (F2023 R1526-R1528). This enables calls of
the form:

  call sub((flag ? a : b))
  call sub((x > 10 ? a : x > 5 ? b : c))
  call sub((flag ? a : .NIL.))

- Add ConditionalArg and ConditionalArgTail parse tree nodes
- Add Nil empty class for .NIL. representation
- Add ConditionalArg as a new alternative in ActualArg
- Add parser rules for conditional-arg, consequent, and chained branches
- Add unparse support for round-trip printing
- Add dump-parse-tree and FeatureList support
- Add parser tests covering simple, multi-branch, .NIL., BOZ, NULL(),
keyword arguments, and module procedure cases
2026-04-23 15:06:03 -05:00
Caroline Newcombe 7779ee8c0e [flang] Support polymorphic types in conditional expressions (#192684)
Add lowering support for polymorphic (`CLASS(T)`) conditional
expressions.

`ConditionalExpr::GetType()` now checks both branches and returns the
polymorphic type if either is polymorphic (F2023 10.1.4(7)). In
lowering, polymorphic conditionals use `fir::ClassType` instead of
`fir::BoxType` for the allocatable temporary so that dynamic type info
is preserved through `hlfir.assign` realloc.

Covers scalar, array, and mixed `TYPE(T)`/`CLASS(T)` operands. Unlimited
polymorphic `CLASS(*)` does not have a declared type, and is therefore
rejected in semantics. LIT tests for lowering and semantics have been
updated.
2026-04-23 11:16:43 -05:00
Eugene Epshteyn 49dad16724 [flang] Ignore -fno-realloc-lhs for polymorphic allocatable LHS with warning (#192697)
When -fno-realloc-lhs is specified and the LHS of an assignment is a
polymorphic allocatable (class(*) or class(T)), reallocation semantics
are required by the Fortran 2003 standard for dynamic type tracking and
cannot be safely skipped. Previously, the compiler generated invalid FIR
in such cases (type mismatch between i32 and
!fir.class<!fir.heap<none>>), causing a compilation error.

With this change, when -fno-realloc-lhs is in effect and a polymorphic
allocatable LHS is detected, the compiler emits a warning that the
option is being ignored for that assignment and proceeds with
reallocation semantics.
2026-04-23 09:34:11 -04:00
Valentin Clement (バレンタイン クレメン) 68d22f459e [flang][cuda] Only apply the implicit data attribute on the component for use_device (#192146)
For interoperability between CUDA Fortran and OpenACC, the OpenACC
host_data use_device clause needs implicitly add the DEVICE attribute to
the object symbol for the duration of the region. When the object was a
component, we were adding the symbol to the base which is not what we
want.
Update the handling to copy the base symbol with a new DerivedTypeScope
and set the attribute on the component. New test is added to test the
behavior is indeed on the component.
2026-04-20 10:10:57 -07:00
Valentin Clement (バレンタイン クレメン) 996efeaaa2 [flang][cuda] Implicitly set bind(c) called kernel as global (#191050) 2026-04-08 14:53:34 -07:00
Caroline Newcombe 802c5cbe5b [flang] Implement conditional expressions parser/semantics (F2023) (#186489)
## Implement Fortran 2023 Conditional Expressions (R1002)

***This PR contains the implementation for parsing and semantic
analysis. Lowering is implemented in a separate PR (#186490)***

Implements Fortran 2023 conditional expressions with syntax: `result =
(condition ? value1 : condition2 ? value2 : ... : elseValue)`

Issue: #176999
Discourse:
https://discourse.llvm.org/t/rfc-adding-conditional-expressions-in-flang-f2023/89869/1
-- note that some of the details provided in the RFC post are no longer
accurate

### Implementation Details
**Parser:**
- Added ConditionalExpr as primary expression (F2023 R1002)  
- Right-associative chaining for multi-way conditionals
 
**Semantics:**
- Expression tree node ConditionalExpr<T> with N conditions and N+1
values
- Strict type checking: all values must have identical type, kind, and
rank
- Conditions must be scalar LOGICAL

**LIT Testing:**
- Parser tests: Syntax validation, precedence, nesting
- Semantic tests: Type checking, error messages
- Note: Executable tests will be added to the llvm-test-suite repo
(https://github.com/llvm/llvm-test-suite/pull/369)

**Limitations**
- Conditional arguments are not yet supported. This work is planned 
    - #180592
- Polymorphic types (CLASS) not yet supported in lowering
- Both limitations will emit clear error message if encountered

### Examples
```
! Simple conditional
x = (flag ? 10 : 20)

! Chained
result = (x > 0 ? 1 : x < 0 ? -1 : 0)

! Examples from F2023
( ABS (RESIDUAL)<=TOLERANCE ? ’ok’ : ’did not converge’ )
( I>0 .AND. I<=SIZE (A) ? A (I) : PRESENT (VAL) ? VAL : 0.0 )
```

AI Usage Disclosure: AI tools (Claude Sonnet 4.5) were used to assist
with implementation of this feature and test code generation. I have
reviewed, modified, and tested all AI-generated code.
2026-04-08 11:27:12 -05:00
Valentin Clement (バレンタイン クレメン) 9b83139177 [flang][cuda] Relax check on chevron syntax for bind(c) callee (#190861) 2026-04-07 20:45:07 -07:00
Peter Klausler ca07ca0314 [flang] Fix confusing explanatory error message (#187341)
When a reference to a generic procedure fails, the compiler explains why
each of the generic's specific procedures failed to match the actual
arguments. This code had a subtle bug: adjustments to the actual
arguments made for interface checking for earlier specific procedures
would persist and affect the checks for later specific procedures.
2026-03-18 17:04:47 -05:00
Peter Klausler 28d294e080 [flang] Let -fdisable-real-10 affect only user code (#183870)
Don't let -fdisable-real-10 elicit errors from intrinsic modules.
2026-03-02 09:45:39 -08:00
Peter Klausler d1f4f9453c [flang] Fix explanatory messages for generic resolution error (#183565)
The compiler emits messages to explain why each of a generic procedure's
specific procedures is not a match for a given set of actual arguments.
In the case of specific procedures with PASS arguments in derived type
procedure bindings or procedure components, these explanatory messages
are often bogus, because the re-analysis didn't adjust the actual
arguments to account for the PASS argument. Fix.
2026-02-27 11:31:51 -08:00
Peter Klausler 0d6f658462 [flang] Catch recursive call to non_recursive ENTRY (#182971)
The check for a recursive call to a non-recursive subprogram doesn't
allow for the case of an alternate ENTRY point.
2026-02-26 07:01:18 -08:00
Zhen Wang 792ac8e94c [flang][cuda] Resolve generic tie‑breaks using per‑arg CUDA distance (#181038)
Switch CUDA generic resolution to compare per‑argument CUDA matching
distances lexicographically instead of summing them. This prevents
ambiguous matches when different specifics yield the same total
distance.
2026-02-13 04:04:07 +00:00
Peter Klausler 73b83be1c9 [flang] Add warning and documentation for extension (#179708)
When a pointer component has no default initialization in the derived
type definition and does not appear explicitly as a component in a
structure constructor, we assume that it is meant to be NULL() as an
extension. But there's no warning or documentation for this extension;
add them.

Fixes https://github.com/llvm/llvm-project/issues/179580.
2026-02-06 09:32:16 -08:00
Peter Klausler 9d0043a35f [flang] Refactor "unused"/"used without definition" warnings (#179539)
I'm emitting a false warning "used without definition" warning for
variable cited in an inquiry intrinsic (e.g. LBOUND), and failing to
emit an "unused local" warning for allocatables that only appear in
ALLOCATE statements.

This patch makes the analysis more context-aware by rewriting it in
terms of typed expression traversal, and moves the analysis part into
Evaluate/check-expression.cpp from Semantics/expression.cpp.
2026-02-06 09:29:50 -08:00
Peter Klausler 6577aa54e8 [flang] Fix proc ptr default initializers in structure constructors (#178897)
The default initializers for procedure pointer components are not being
used for unspecified components in structure constructors.

Fixes https://github.com/llvm/llvm-project/issues/178813.
2026-01-31 14:48:32 -08:00
Peter Klausler 55ee00e15f [flang][CUDA] Allow constant to match device actual in specific procedure (#178658)
When scanning the specific procedures of a generic interface for a match
for a set of actual arguments, accept a constant actual argument as a
match for a dummy argument with the DEVICE attribute.
2026-01-31 14:47:49 -08:00
Peter Klausler 20103eeb3a [flang] Fix exposed "free" instances of ac-implied-do indices (#178516)
Tweak the implementations of IsConstantExpr, IsInitialDataTarget, and
related utilities so that "free" instances of array constructor implied
DO indices are not treated as constant expressions when the surrounding
context (if any) doesn't contain their bounds. This fixes a current bug
in which a "free" implied DO index in a structure constructor got
wrapped up an a Constant<SomeDerived>, which led to a crash in lowering.
2026-01-31 14:47:29 -08:00
Katherine Rasmussen 5136b04dd2 [flang] Remove AmbiguousStructureConstructor warnings (#178088)
Remove `AmbiguousStructureConstructor` warnings. This removes harmless
warnings about standards-conforming generic function references that
are never ambiguous with structure constructors.
2026-01-28 10:32:41 -08:00
Peter Klausler d69ad211b5 [flang] Missing function-vs-subroutine checks on bindings (#177699)
Derived type procedure bindings aren't always subject to the checks of
the function-vs-subroutine classification flags on their symbol table
entries in name resolution, and we're missing some cases that aren't
caught later in expression semantics, which assumed that name resolution
would have already handled them. So check function-vs-subroutine errors
on bindings in expression semantics entirely.

Fixes https://github.com/llvm/llvm-project/issues/177601.
2026-01-27 08:23:23 -08:00
Krzysztof Parzyszek d542fac6b1 [flang] Add traits to more AST nodes (#175578)
Follow-up to PR175211.

There are still a few AST nodes that don't have any of the standard
traits (Wrapper/Tuple/etc). Because of that they require special
handling in the parse tree visitor.

Convert a subset of these nodes to the typical format, and remove the
special cases from the parse tree visitor.

The members of these nodes were frequently used, so instead of
extracting them by hand each time use helper member functions to access
them.
2026-01-20 09:57:35 -06:00
Krzysztof Parzyszek b8fec8ebc6 [flang] Add traits to more AST nodes (#175566)
Follow-up to PR175211.

There are still a few AST nodes that don't have any of the standard
traits (Wrapper/Tuple/etc). Because of that they require special
handling in the parse tree visitor.

Convert a subset of these nodes to the typical format, and remove the
special cases from the parse tree visitor.
2026-01-20 08:00:00 -06:00
Peter Klausler 455de5543c [flang] Fix non-portable TYPE(*) usage in generic (#176235)
Fortran allows a scalar actual argument of any type to correspond with a
TYPE(*) dummy argument that is an assumed-size array. This usage isn't
portable, and it didn't work with a generic procedure with this
compiler, only specific procedures. It affected at least one API in
OpenMPI.

Fix generic resolution to allow for this case, add a distinguishability
test to detect generic interfaces that have ambiguous specific
procedures due to it, and add an optional portability warning (off by
default).
2026-01-19 11:00:26 -08:00
Krzysztof Parzyszek 568b8e4873 [flang] Add traits to several AST nodes (#175065)
There are quite a few AST nodes that don't have any of the standard
traits (Wrapper/Tuple/etc). Because of that they require special
handling in the parse tree visitor.

Convert a subset of these nodes to the typical format, and remove the
special cases from the parse tree visitor.
2026-01-08 18:26:48 -06:00
TMJ fcec9ced47 [flang] Do not error on constant nonzero UB in substring of ZLA (#174511)
A substring reference where the lower bound is higher than the upper
bound is defined in 9.4.1 to be zero-length.

Thus, a reference to a substring of a CHARACTER*(0) string such as

    string(foo():2)

cannot be a compile-time error since we do not know the return value of
foo().

We also should not error if the lbound > ubound at compile time.
2026-01-08 13:28:48 -05:00
Leandro Lupori fa53d9285a [flang] Check for errors when analyzing array constructors (#173092)
Errors in array constructor values result in the array having
less elements than it should, which can cause other errors that
will confuse the user. Avoid this by not returning an expression
on errors.

Fixes #127425
2026-01-08 11:33:21 -03:00
Peter Klausler 420437e33f [flang] Emit warnings, not errors, for bad subscripts in dead code (#174040)
When semantics is checking expressions in known dead branches of IF
constructs, errors should not be fatal; emit warnings instead, and allow
them to be disabled.

Fixes https://github.com/llvm/llvm-project/issues/171844.
2025-12-31 13:29:29 -08:00
Peter Klausler 1a60e53b2d [flang] Catch misuse of assumed-rank dummy argument (#173786)
Assumed-rank dummy arguments can't be parenthesized.

Fixes https://github.com/llvm/llvm-project/issues/173593.
2025-12-31 12:43:09 -08:00
Peter Klausler 5fc77c1666 [flang] Add new warnings for unused & undefined locals (#173504)
Add a requested warning for completely unused local variables. The
implementation runs a scan over typed expressions during the existing
expression semantics pass to detect variable uses, and a routine at the
end of semantics to take a pass over the symbol tables to find unused
locals.

The new infrastructure needed to detect variable uses, and the existing
infrastructure that detects potential variable definitions, then makes
it easy to detect variables that are used without any possible
initialization or definition, so I did that too.

The warning for unused locals is off by default -- they might indicate a
misspelling (that IMPLICIT NONE would have caught), but seem otherwise
generally benign. The warning for uses of completely uninitialized and
undefined variables, however, is enabled by default, since that's likely
to indicate a program bug that should be investigated.

This patch touches a lot of files lightly. Many of these files are tests
that would have produced needless warning noise; one new test was added.

Fixes https://github.com/llvm/llvm-project/issues/173276.
2025-12-31 12:42:06 -08:00
Peter Klausler 9c3955afd8 [flang] Use instantiated PDT for structure constructor in default init (#167409)
A structure constructor used in (or as) the default component
initializer for a PDT derived type component needs to traverse the scope
of the right PDT instantiation.

Fixes https://github.com/llvm/llvm-project/issues/167337 and fixes
https://github.com/llvm/llvm-project/issues/167573.
2025-11-14 08:23:24 -08:00
Jean-Didier PAILLEUX 87fb7b002d [flang] Adding NOTIFY specifier in image selector and add notify type checks (#148810)
This PR adds support for the NOTIFY specifier in the image selector as
described in the 2023 standard, and add checks for the NOTIFY_TYPE type.
2025-11-05 16:35:25 +01:00
Peter Klausler 5354681c6d [flang] Better folding warning due to hidden conversion (#165430)
When folding intrinsic function calls for types like REAL(2) that don't
have host math library support, we convert them to a type that has
greater range and precision, call a host math library routine that does
exist, and convert the result back to the original result type. The
folding of this second conversion can elicit floating-point warnings
(usually overflow) that are somewhat unclear to the user. Add support
for adding contextual information to these warnings.
2025-10-31 10:26:49 -07:00
Peter Klausler e34d603f18 [flang] More information on generic resolution failures (#164738)
When a generic procedure reference does not match any of its specific
procedures, run through them and emit the errors for each attempted
match, so that the user has more information to resolve the problem by
adjusting the actual arguments.
2025-10-24 14:14:59 -05:00
Peter Klausler a6181dc84b [flang] Refine checks for NULL() in expressions (#163655)
Fix a false positive "NULL can't be an operand here" error message
arising in a defined generic interface for an intrinsic operator (==)
with multiple spellings.

Fixes https://github.com/llvm/llvm-project/issues/163255.
2025-10-16 12:20:53 -07:00