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

George Burgess IV via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 19 14:40:14 PDT 2016


george.burgess.iv marked an inline comment as done.

================
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;
+
----------------
rsmith wrote:
> Do we reach a `DiagnoseUseOfDecl` somewhere in here?
Good catch. 

On a slightly related side note, it seems that `ResolveAndFixSingleFunctionTemplateSpecialization` doesn't check for member access (though it does call `DiagnoseUseOfDecl`). Will commit a fix for that separately. :)


http://reviews.llvm.org/D17701





More information about the cfe-commits mailing list