[cfe-dev] Late-parsing function templates in tools

Kim Gräsman via cfe-dev cfe-dev at lists.llvm.org
Tue Mar 27 11:50:20 PDT 2018


If that's the case, that would be a time for celebration for portable code!

But then again, there are probably several active VS2012 shops still
out there; when I was still using MSVC, I found the ecosystem was
often very difficult to upgrade (often precompiled non-source
third-parties, several different build configurations, etc, etc). So
at least from IWYU's perspective, it might be a little premature to
kill off support for delayed template parsing.

- Kim

On Tue, Mar 27, 2018 at 8:33 PM, Reid Kleckner <rnk at google.com> wrote:
> No, it doesn't do that, but it's right where we'd go through and parse all
> the late-parsed templates for tools.
>
> Honestly, I think delayed template parsing may be nearing the end of its
> useful life. It may be causing more problems than it solves for users. We
> should re-examine what MSVC allows in its default build modes and see if we
> can get it turned off by default. Most Windows system headers these days are
> supposed to be compilable with /permissive-, which is more conforming.
>
> On Tue, Mar 27, 2018 at 11:19 AM Kim Gräsman <kim.grasman at gmail.com> wrote:
>>
>> Hi Reid,
>>
>> Thanks for the followup!
>>
>>
>> Den mån 26 mars 2018 20:38Reid Kleckner <rnk at google.com> skrev:
>>>
>>> It sounds like this issue would be fixed if we did what you are doing
>>> (parsed all late parsed function templates) within
>>> Sema::ActOnEndOfTranslationUnit, is that right?
>>>
>>> If so, that would be a pretty reasonable extension for tools.
>>
>>
>> Is that what your recent patch in r328567 does? I suppose we just need a
>> tooling flag to force it to happen?
>>
>> I wonder if you should add a test with the
>> GNU-builtin-inside-function-template that I mentioned above. But I guess
>> TUScope is always non-NULL in Sema::ActOnEndOfTranslationUnit.
>>
>> Let me pull latest and try this out and see if I can learn more.
>>
>> - Kim
>>
>



More information about the cfe-dev mailing list