[LLVMbugs] [Bug 18714] MS compatibility: Use token-based instantiation for -fdelayed-template-parsing

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 10 12:37:05 PDT 2014


Reid Kleckner <rnk at google.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #2 from Reid Kleckner <rnk at google.com> ---
(In reply to comment #1)
> Can you give some pointers on the nature of the token transformation?
> Do you have a feel for the phases of token caching, instantiation and
> substitution that might be going on in MSVC?

First, I just want to say that I've been talked out of this approach since I
filed this bug, so I'm closing it.  :)

Answering your question, yes, they appear to do roughly what
-fdelayed-template-parsing does: they parse class template bodies, but they
slurp the tokens from C++ inline method definitions and parse them once they
are instantiated and referenced.  I believe you *need* to use typename with
MSVC when appropriate in a class template body outside of C++ inline methods.

The key difference is that method bodies are *never* parsed prior to
instantiation.  The template parameters are substituted with arguments before
parsing, so MSVC always knows if a nested-name-specifier is a type.

Basically, I've gotten the hang of recovering from missing 'typename' now, so I
don't think it will be that hard to handle this without token substitution.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140610/b5ab8fa0/attachment.html>

More information about the llvm-bugs mailing list