
Doug Gregor wrote:
Dave Abrahams wrote:
Now it's my turn to be a little skeptical. I can't imagine a compiler would ever try to do error recovery by throwing out all the information from #include files you had already processed.
Heck no! But in the absence of information (e.g., an #include couldn't be found, or an identifier is horribly mis-typed), such approaches could drastically improve recovery.
From my naive user point of view, there is a "preprocessing" step, a "compilation" step and a "linking" step. As a compiler user, I would prefer that the compiler doesn't start the "compilation" step in case the "preprocessing" step failed (e.g., an #include couldn't be found). Similar, I would prefer that the compiler doesn't start the "link" step in case the "compilation" step failed.
I know that GCC has a different opinion about this, but I prefer the behavior MSVC in this case. Regards, Thomas