llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

QOI: arguments passed/required mismatch diagnostic

Open echristo opened this issue 16 years ago • 4 comments

Bugzilla Link 6501
Resolution FIXED
Resolved on Apr 15, 2010 23:57
Version trunk
OS All
CC @echristo

Extended Description

It would be useful when emitting a diagnostic for "too many/few arguments to {thing} x" that it provide some numbers of what the expected and seen number of arguments were.

echristo avatar Mar 05 '10 03:03 echristo

Finished off thusly:

[issola:llvm/tools/clang] echristo% svn ci Sending include/clang/Basic/DiagnosticSemaKinds.td Sending lib/Sema/SemaChecking.cpp Sending lib/Sema/SemaExpr.cpp Sending lib/Sema/SemaExprObjC.cpp Transmitting file data .... Committed revision 101442.

echristo avatar Apr 16 '10 06:04 echristo

Partially fixed thusly:

Sending include/clang/Basic/DiagnosticSemaKinds.td Sending lib/Sema/SemaChecking.cpp Sending lib/Sema/SemaExpr.cpp Sending lib/Sema/SemaExprObjC.cpp Transmitting file data .... Committed revision 101441.

Need to get the "many" part now.

echristo avatar Apr 16 '10 06:04 echristo

OK. I fixed the last one so here's one:

[ghostwheel:~] echristo% ~/builds/build-llvm/Debug/bin/clang -msse4.1 foo.c -S foo.c:4:37: error: too few arguments to function call return __builtin_ia32_roundss(a, 4); ~~~~~~~~~~~~~~~~~~~~~~ ^ 1 diagnostic generated.

[ghostwheel:~] echristo% cat foo.c #include <smmintrin.h>

__m128i foo (__m128 a, __m128 b) { return __builtin_ia32_roundss(a, 4); }

perhaps a "got 2, expected 3" here would be good?

echristo avatar Mar 05 '10 03:03 echristo

Please include an example that triggers this warning.

lattner avatar Mar 05 '10 03:03 lattner