[PATCH] D66437: Sema: Create a no-op implicit cast for lvalue function conversions.

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 5 18:35:17 PST 2019


aaronpuchert added inline comments.


================
Comment at: clang/lib/Sema/SemaInit.cpp:4745
+      else if (FunctionConversion)
+        Sequence.AddQualificationConversionStep(cv1T1, VK_LValue);
 
----------------
Is this a qualification conversion though? The standard lists it "function pointer conversion".


================
Comment at: clang/test/CodeGenCXX/implicit-function-conversion.cpp:6-7
+
+// CHECK: call i32 @_Z1bRFddE(double (double)* @_Z1ad)
+int c = b(a);
----------------
Wouldn't it make slightly more sense to check the AST for a specific `ImplicitCastExpr`? This test would have passed before your change when assertions are turned off, if I'm not mistaken.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66437/new/

https://reviews.llvm.org/D66437





More information about the cfe-commits mailing list