On Thu, Jun 13, 2013 at 5:12 PM, Olivier Goffart <[email protected]> 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 [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
