[clang] [Sema] Check arg count for builtins with CustomTypeChecking (PR #222841)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 14 08:58:01 PDT 2026


================
@@ -145,6 +145,16 @@ bool SemaPPC::CheckPPCBuiltinFunctionCall(const TargetInfo &TI,
   //  - IsIntType: enforces any integer type
   // Lambdas centralize type checks for BCD builtin handlers
 
+  // reject calls with more args than the builtin's declared prototype
----------------
AaronBallman wrote:

> cuz if we fix the double diagnostic issue by removing the checks and we dont need any more after removing "t" (already being handled by Sema's normal checking) we would have a different diagnostic message that the normal Sema will give us but that will need to update the diagnostic expectation of a lot of checks in many test files here..

Updating for different diagnostics seems pretty reasonable to me. My thinking is: the original builtins were adding `t` when it didn't need to be added, now that we're finding bugs with that approach, we should fix the approach rather than address the symptoms even if that means updating test cases.

However, I'd like to hear from @hubert-reinterpretcast or @amy-kwan (or anyone else invested in PowerPC builtins) to see if they agree with my assessment.

https://github.com/llvm/llvm-project/pull/222841


More information about the cfe-commits mailing list