<div dir="ltr">I'm kind of torn. I can see why users would want to switch between SDK header parsing mode and user code parsing mode for more conforming diagnostics, but I worry about the support burden of allowing the template parsing mode to switch halfway through the TU. General opinion among colleagues seemed to be that less state and fewer pragmas is better.<div>
<br></div><div>I'd rather make it to a world where we don't have non-conforming headers than a world where we have pragmas and complex include-shadowing systems to work around non-conforming headers, but maybe that's too idealistic.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 3, 2014 at 11:41 AM, Nico Rieck <span dir="ltr"><<a href="mailto:nico.rieck@gmail.com" target="_blank">nico.rieck@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Currently delayed template parsing is enabled by default for Windows<br>
because some Windows SDK headers and ATL require it (though forward<br>
declaring "struct IUnknown;" seems to suffice for large parts of the<br>
SDK, including 3D and multimedia). As it is implemented, delayed<br>
template parsing is all-or-nothing and user code is forced to accept the<br>
relaxed parsing rules.<br>
<br>
I have been toying with the idea to make delayed template parsing<br>
controllable via pragma so it can be enabled just for offending headers.<br>
This pragma might take the following form with the default state<br>
determined by -fdelayed-template-parsing:<br>
<br>
#pragma delayed_template_parsing(push, [on|off])<br>
#pragma delayed_template_parsing(pop)<br>
<br>
This would be the first pragma to not delegate to Sema because this must<br>
be handled in the parser.<br>
<br>
Before I clean it up and put out a patch I'd like to get some feedback<br>
on whether this direction taken is acceptable.<br>
<br>
-Nico<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>