[clang] [WebAssembly][Clang] Add __builtin_wasm_ref_is_null_extern (PR #139580)

Hood Chatham via cfe-commits cfe-commits at lists.llvm.org
Mon May 12 15:45:56 PDT 2025


================
@@ -168,7 +168,7 @@ bool Sema::checkArgCount(CallExpr *Call, unsigned DesiredArgCount) {
 
   return Diag(Range.getBegin(), diag::err_typecheck_call_too_many_args)
          << 0 /*function call*/ << DesiredArgCount << ArgCount
-         << /*is non object*/ 0 << Call->getArg(1)->getSourceRange();
+         << /*is non object*/ 0 << Range;
----------------
hoodmane wrote:

It seems to have fixed a real bug in the labeling:
```C
$ clang -c a.c 
a.c:2:30: error: too many arguments to function call, expected 2, have 4
    2 |   __builtin_annotation(1, 2, 3, 4);
      |                           ~  ^
1 error generated.
$ ./bin/clang -c a.c 
a.c:2:30: error: too many arguments to function call, expected 2, have 4
    2 |   __builtin_annotation(1, 2, 3, 4);
      |                              ^~~~
1 error generated.
```

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


More information about the cfe-commits mailing list