[clang] [Clang] Static and explicit object member functions with the same parameter-type-lists (PR #93430)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 27 09:57:55 PDT 2024


================
@@ -5813,6 +5813,24 @@ static TypoCorrection TryTypoCorrectionForCall(Sema &S, Expr *Fn,
   return TypoCorrection();
 }
 
+static bool isParenthetizedAndQualifiedAddressOfExpr(Expr *Fn) {
+  if (!isa<ParenExpr>(Fn))
+    return false;
+
+  Fn = Fn->IgnoreParens();
+  auto *UO = dyn_cast<UnaryOperator>(Fn);
+  if (!UO)
+    return false;
+  assert(cast<UnaryOperator>(Fn)->getOpcode() == UO_AddrOf);
----------------
Sirraide wrote:

What about e.g.
```c++
void f() {}
void g() { (*&f)(); }
```
Wouldn’t that run into this assertion here?

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


More information about the cfe-commits mailing list