[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-commits
Subject:    Re: [PATCH] Fix parsing comma in default arguments.
From:       Richard Smith <richard () metafoo ! co ! uk>
Date:       2013-06-14 0:40:25
Message-ID: CAOfiQqmxUM4q6XOoqVStHNFnEuH-tUYhR7u9mgt+2ipTk=YiSA () mail ! gmail ! com
[Download RAW message or body]

On Thu, Jun 13, 2013 at 5:12 PM, Olivier Goffart <ogoffart@kde.org> wrote:
> On Thursday 13 June 2013 16:30:22 Eli Friedman wrote:
>> > > > Also a template argument can contains = for example in this case:
>> > > >  struct S {constexpr S(){}; constexpr int operator=(int) const {return
>> > > >  5;}};
>> > > >  template <int> struct A {};
>> > > >  constexpr S s;
>> > > >  A<s=4> a;
>> > >
>> > > This is ill-formed.
>> >
>> > Why?
>> > the operator= is a constexpr
>>
>> It isn't a question of what operator= resolves to; the issue is that the
>> grammar doesn't allow an '=' in that spot.  See [gram.expr].
>
> Ah, right.
>
> But this would be valid:
>   A<false ? s=1 : s=4 > a;

Yes, it would.
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic