[flang-commits] [flang] [flang][cuda] Compute matching distance in generic resolution (PR #90774)
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Wed May 1 13:58:35 PDT 2024
================
@@ -2575,19 +2659,30 @@ std::pair<const Symbol *, bool> ExpressionAnalyzer::ResolveGeneric(
CheckCompatibleArguments(*procedure, localActuals)) {
if ((procedure->IsElemental() && elemental) ||
(!procedure->IsElemental() && nonElemental)) {
- // 16.9.144(6): a bare NULL() is not allowed as an actual
- // argument to a generic procedure if the specific procedure
- // cannot be unambiguously distinguished
- // Underspecified external procedure actual arguments can
- // also lead to ambiguity.
- return {nullptr, true /* due to ambiguity */};
+ int d{ComputeCudaMatchingDistance(*procedure, localActuals)};
+ if (d != crtMatchingDistance) {
+ if (d > crtMatchingDistance) {
----------------
klausler wrote:
Braces, please.
https://github.com/llvm/llvm-project/pull/90774
More information about the flang-commits
mailing list