There was a search for non-prototype declarations for the function, but
we only showed the results for zero-parameter functions. Now we show the
note for functions with parameters as well, but we omit the fix-it hint
suggesting to add void.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM!
lib/Sema/SemaDecl.cpp | ||
---|---|---|
13335 ↗ | (On Diff #204171) | In this case, we could probably generate the parameter declarations for the user still, couldn't we? e.g., int f(); // We could insert "int i, int j" here as the fixit int g(); // Just like we try to suggest "void" here already int f(int i, int j) { return i + j; } int g(void) { return 12; } That could be done in a follow-up patch though. |
lib/Sema/SemaDecl.cpp | ||
---|---|---|
13335 ↗ | (On Diff #204171) | One difficulty might be that certain types used in the parameter list of the definition aren't available where the declaration is, like int f(); struct X { int n; }; int f(struct X *x) { return x->n;} So I'm not sure we can always do it, but sometimes perhaps. |
lib/Sema/SemaDecl.cpp | ||
---|---|---|
13335 ↗ | (On Diff #204171) | That's a good point and reason enough to not try for it in this version of the patch (if at all). |