[lldb-dev] Can't use template aliases in LLDB

Zachary Turner zturner at google.com
Tue Feb 17 15:33:32 PST 2015


+lldb-dev at cs.uiuc.edu <lldb-dev at cs.uiuc.edu>  since this is of general
interest.

A little background: template aliases are a new C++11 feature.  If you
aren't familiar with it, then the simple TL;DR version of it is that it's
like a template typedef.  The syntax for using one looks like this:

template<class T>
using Foo = std::list<T>   // Foo<T> is the same as std::list<T> now.

Up until last weekend, LLVM's minimum toolchain requirement was MSVC 2012,
which did not support template aliases at all, so they were banned.  Last
weekend we upgraded the minimum required version to MSVC 2013, which we
thought would allow template aliases to be used.  Unfortunately, this is
not the case.  A base install of MSVC 2013 with no updaets will still not
compile template aliases.  I believe we're actually requiring MSVC 2013
Update 4 as the baseline, but sadly this doesn't fix the problem.  A fully
updated MSVC 2013 will compile them, but generate incorrect code.  This is
more sinister, since it means you can use them, but the code won't work.

As a result, template aliases are still banned until we upgrade the minimum
required version to 2015, which will still be a while as it's not
officially out yet.  Please keep this in mind and try not to use them when
writing new code.  Thanks!



On Tue Feb 17 2015 at 3:21:03 PM Vince Harron <vharron at google.com> wrote:

> Hi Tamas,
>
> zturner@ informed me that MSVC 2013 doesn't generate correct code for
> template alases.  Can you remove your use on
>
> "GDBRemoteCommunicationServerCommon.h, lines 182 and 183"
>
> Thanks,
>
> Vince
>
>
> --
>
> Vince Harron | Technical Lead Manager | vharron at google.com | 858-442-0868
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150217/997bc7ed/attachment.html>


More information about the lldb-dev mailing list