[LLVMdev] Using C++'11 language features in LLVM itself

Michael Spencer bigcheesegs at gmail.com
Fri Jan 11 11:38:25 PST 2013


On Fri, Jan 11, 2013 at 11:32 AM, Sebastian Redl
<sebastian.redl at getdesigned.at> wrote:
>
> On 11.01.2013, at 20:08, Eli Bendersky wrote:
>
>>>> I suppose this tradeoff can be evaluated by looking at the delta
>>>> between 4.5 and 4.6 which is actually supported by MSVC 2010 and Clang
>>>> 3.1
>>>
>>> Makes perfect sense to me.
>>>
>>> -Chris
>>
>> According to http://gcc.gnu.org/projects/cxx0x.html, these features
>> are available from 4.6 (language features only):
>>
>> - Null pointer constant
>
> This is the only one fully supported by VS 2010.
>
>> - Forward declarations for enums
>
> This is partially supported. I don't know the exact extent.
>
>> - Generalized constant expressions
>> - Unrestricted unions
>> - Range-based for
>> - Defining move special member functions
>> - Allowing move constructors to throw
>
> These are all unsupported.
>
> So the question is, is nullptr worth requiring 4.6.
>
> Sebastian

nullptr fixes a bug with 2010's implementation of std::pair.

std::pair<int*, int*> a = std::make_pair(0, 0);

That doesn't work in 2010 :( (It was actually a bug in the standard
draft at the time 2010 came out)

- Michael Spencer



More information about the llvm-dev mailing list