[clang] [Sema] Compare canonical conversion function (PR #154158)

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 20 07:08:59 PDT 2025


================
@@ -0,0 +1,143 @@
+// RUN: rm -rf %t
----------------
vgvassilev wrote:

I'd start from something like:
```cpp
typedef int (*ifn)();
struct F {
  operator ifn();
};

int main() {
  int i1 = 0;
  ifn pfn = i1 ? F() : main;
}
```

That would get us into the branch we added. I looked briefly at this test and it seems we pull the two different operators through ADL (there are some namespaces and friend functions involved.) Perhaps we could enhance our `F` to turn on such a behavior but I will have to time out for today.

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


More information about the cfe-commits mailing list