[cfe-commits] [patch] decltype in mem-initializers

David Blaikie dblaikie at gmail.com
Mon Jan 23 22:09:42 PST 2012


On Mon, Jan 23, 2012 at 9:12 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> LGTM.

Thanks, committed as r148789.

> It wasn't instantly obvious to me why we can be sure that the kw_decltype
> token has been annotated here; I imagine a comment indicating that
> ParseOptionalCXXScopeSpecifier will convert the next token into such an
> annotation would be useful for future readers.

Added a clarifying comment - helps to have some extra eyes on it to
see these things. After staring at/playing with only N3031 & some
related decltype uses for a few months (in my spare time) I didn't
really have a very separated viewpoint by the time I was writing this
code.

- David

> - Richard
>
> On Sat, January 21, 2012 09:24, David Blaikie wrote:
>> Bump. It's really not a terribly big patch or anything... honest.
>>
>>
>> On Mon, Jan 9, 2012 at 9:42 PM, David Blaikie <dblaikie at gmail.com> wrote:
>>
>>> Bump again (patch sync'd/updated, though there weren't any conflicts)
>>>
>>>
>>> On Fri, Dec 16, 2011 at 8:02 AM, David Blaikie <dblaikie at gmail.com> wrote:
>>>
>>>> Bump and... hey, why not attach the patch.
>>>>
>>>>
>>>> On Wed, Dec 7, 2011 at 10:48 PM, David Blaikie <dblaikie at gmail.com>
>>>> wrote:
>>>>
>>>>> Another small/simple patch to add support for decltype in
>>>>> mem-initializers such as this:
>>>>>
>>>>> struct Base { Base(int); }; struct Derived : Base {  Derived() :
>>>>> decltype(Base(1))(3) { // initializing base  }
>>>>>  Derived(int) : decltype(Derived())() { // forwarding ctor
>>>>>  }
>>>>> };
>>>>>
>>>>>
>>>>> Thanks again,
>>>>> - David
>>>>>
>>>>>
>>>>> [After this & the other patch I have out I should only have pseudo
>>>>> destructors left before we've finished N3031 (minor niggling leftover is
>>>>> that I need to go back & preclude the use of decltype in
>>>>> nested-name-specifiers that are used in declarator-ids, strangely -
>>>>> 8.3\1)]
>>>>>
>>
>




More information about the cfe-commits mailing list