[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:       Olivier Goffart <ogoffart () kde ! org>
Date:       2013-06-14 0:12:09
Message-ID: 4498731.SKW3QCO6kk () gargamel
[Download RAW message or body]

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;

-- 
Olivier
_______________________________________________
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