Q. on recent fixit changes

I've seen a difference in whether some fixits are produced, recently
(i.e. sometime between r222093 and r222640). Mainly I want to know
whether it's intentional, given the recent changes to fixit handling
(which I didn't really pay much attention to). If it's intentional,
cool, I'll just update my tests; but if it isn't, then I can file a
bug so somebody can look into it.

Given the following source:

namespace std {
  void *junk();
};
int main() {
  delete junk;
  return 0;
}

This used to get an error with a fixit:

try.cpp:8:10: error: use of undeclared identifier 'junk'; did you mean
      'std::junk'?
  delete junk;
         ^~~~
         std::junk
try.cpp:4:9: note: 'std::junk' declared here
  void *junk();
        ^
try.cpp:8:3: error: cannot delete expression of type 'void *()'
  delete junk;
  ^ ~~~~
2 errors generated.

Now it doesn't:

try.cpp:8:10: error: use of undeclared identifier 'junk'
  delete junk;
         ^
1 error generated.

Thanks,
--paulr

I've seen a difference in whether some fixits are produced, recently
(i.e. sometime between r222093 and r222640). Mainly I want to know
whether it's intentional, given the recent changes to fixit handling
(which I didn't really pay much attention to). If it's intentional,
cool, I'll just update my tests; but if it isn't, then I can file a
bug so somebody can look into it.

Given the following source:

namespace std {
  void *junk();
};
int main() {
  delete junk;
  return 0;
}

This used to get an error with a fixit:

try.cpp:8:10: error: use of undeclared identifier 'junk'; did you mean
      'std::junk'?
  delete junk;
         ^~~~
         std::junk
try.cpp:4:9: note: 'std::junk' declared here
  void *junk();
        ^
try.cpp:8:3: error: cannot delete expression of type 'void *()'
  delete junk;
  ^ ~~~~
2 errors generated.

Now it doesn't:

try.cpp:8:10: error: use of undeclared identifier 'junk'
  delete junk;
         ^
1 error generated.

As I understand it, this is intentional - we try not to suggest fixits that
would produce cascading failures. Typo correction has recently been
improved along those lines, to delay typo correction until the end of the
full expression - thus allowing more accurate typo corrections (ones that
actually make the whole expression successfully compile) & so we should see
some new cases of suggestions and some cases where bad suggestions no
longer appear.

- David

This is intentional. Note that the old fixit was wrong. We now try to only
issue fixits if they don't result in further errors.