[PATCH] D17701: [Sema] Teach SemaCast to allow reinterpret_casts of overloaded functions with only one addressable candidate

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 18 11:25:55 PDT 2016


rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

OK, though I'm hoping either there aren't many more of these cases or we can treat them more generally somehow.


================
Comment at: lib/Sema/SemaCast.cpp:1771-1782
@@ +1770,14 @@
+
+  DeclAccessPair DAP;
+  FunctionDecl *Found = Self.resolveAddressOfOnlyViableOverloadCandidate(E, DAP);
+  if (!Found)
+    return false;
+
+  Self.CheckAddressOfMemberAccess(E, DAP);
+
+  Expr *Fixed = Self.FixOverloadedFunctionReference(E, DAP, Found);
+  if (Fixed->getType()->isFunctionType())
+    Result = Self.DefaultFunctionArrayConversion(Fixed, /*Diagnose=*/false);
+  else
+    Result = Fixed;
+
----------------
Do we reach a `DiagnoseUseOfDecl` somewhere in here?


http://reviews.llvm.org/D17701





More information about the cfe-commits mailing list