================
@@ -1868,6 +1868,28 @@ bool Sema::IsFunctionConversion(QualType FromType, 
QualType ToType,
       FromFn = QT->getAs<FunctionType>();
       Changed = true;
     }
+
+    if (getLangOpts().CPlusPlus) {
+      // For C, when called from checkPointerTypesForAssignment,
+      // we need not to change the type, or else even an innocuous cast
+      // like dropping effects will fail.
----------------
dougsonos wrote:

In an earlier review your suggestion was (in effect) to do nothing here for C 
while doing the type adjustment for C++.  Is there a more correct way to check 
for plain C than the absence of C++? Or is this just a matter of the comment 
not clearly describing the intent of the code? Thanks.

https://github.com/llvm/llvm-project/pull/84983
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to