[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

Doug Wyatt via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 10 10:25:11 PDT 2024


================
@@ -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


More information about the cfe-commits mailing list