llvm-project
3b3adefd - [Clang] Fix Sema::checkArgCount for 0-arg functions (#139638)

Commit
324 days ago
[Clang] Fix Sema::checkArgCount for 0-arg functions (#139638) When calling a function that expects zero arguments with one argument, `Call->getArg(1)` will trap when trying to format the diagnostic. This also seems to improve the rendering of the diagnostic some of the time. Before: ``` $ ./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); | ~ ^ ``` After: ``` $ ./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); | ^~~~ ``` Split from #139580. --------- Co-authored-by: Mariya Podchishchaeva <mariya.podchishchaeva@intel.com>
Author
Parents
Loading