[cfe-dev] Tooling vs -fdelayed-template-parsing WAS: Clang-cl.exe and the VC++ preprocessor

Kim Gräsman kim.grasman at gmail.com
Mon Aug 4 10:40:07 PDT 2014

On Mon, Aug 4, 2014 at 7:34 PM, Reid Kleckner <rnk at google.com> wrote:

> On Mon, Aug 4, 2014 at 10:26 AM, Kim Gräsman <kim.grasman at gmail.com>
> wrote:
>> We just (a few minutes ago, while experimenting with this) found a case
>> where late-parsing a template whose body contains undefined symbols would
>> generate an incomplete AST, e.g.
>> template<class T>
>> void foo(const T& t) {
>>   UndefinedSymbol::bar(t);  // colon-colon
>> }
>> $ clang-check.exe -ast-dump incomplete.cpp --
>> -fno-delayed-template-parsing
>> TranslationUnitDecl 0xebe7e0 <<invalid sloc>> <invalid sloc>
>> [...]
>> This runs without error [...]
>> I don't know if this is a general bug in the parser, but it'd be nice to
>> always get a diagnostic here.
> This is an -fms-compatibility hack, which is separate from delayed
> template parsing.  I'm surprised we don't have a -Wmicrosoft warning here,
> though.

Thanks, that explains it. I'm about to take off on a road-trip, or I'd
offer to add a warning. If you can give me a hint as to where to start I
may be able to get to it when we get back.

- Kim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140804/a195b102/attachment.html>

More information about the cfe-dev mailing list