Comment #9 on pull request 1083 by bolshakov-a: Avoid autocast assurance for function definition
https://github.com/include-what-you-use/include-what-you-use/pull/1083
> Can you explain this a bit more?
The problem is that for such code:
```cpp
#include "S.h" // S has implicit ctor accepting int
static void fn(const S&) {
}
int main() {
fn(5);
}
```
IWYU from this branch suggests to remove `#include "S.h"`. This is an error not present on master branch, so this PR needs work.
> The challenge is to guess whether the declaration (possibly definition) we're processing should really obey the autocast rules
I think that if a declaration isn't a definition, it should provide autocast possibility, no problem with that. Of course, there are cases like
```cpp
void fn1(const S&); // prototype
void fn2(const S& s) {
fn1(s);
}
void fn1(const S& s) { // definition
...
}
```
when one probably don't want to `#include "S.h"`, but these cases seem to be rare.