[PATCH] D149514: Check if First argument in _builtin_assume_aligned_ is of pointer type

Sergei Barannikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 30 06:17:03 PDT 2023


barannikov88 added inline comments.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:7982
         DefaultFunctionArrayLvalueConversion(FirstArg);
     if (FirstArgResult.isInvalid())
       return true;
----------------
This check is likely also done by `checkBuiltinArgument`.



================
Comment at: clang/lib/Sema/SemaChecking.cpp:7989
+          Context.getPointerType(Context.VoidTy.withConst());
+      return Diag(FirstArg->getBeginLoc(),
+                  diag::err_typecheck_convert_incompatible)
----------------
`checkBuiltinArgument` already issues an error if the argument does not have the correct type.
Please also make sure that other tests pass, they may need some adjustments (`ninja check-clang`).
Ask for a guidance if you don't know how to fix them.



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

https://reviews.llvm.org/D149514



More information about the cfe-commits mailing list