<div dir="ltr">On Thu, Jun 13, 2013 at 4:17 PM, Olivier Goffart <span dir="ltr"><<a href="mailto:ogoffart@kde.org" target="_blank">ogoffart@kde.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thursday 13 June 2013 13:52:47 Richard Smith wrote:<br>
> That's not really acceptable, if it can lead to rejecting valid code<br>
> that we accept now (such as your next example).<br>
<br>
</div>Ok, the new attached patch fixes that issue.<br>
<br>
I'm now quite happy which what (i think) we cover.<br>
It even report good errors when one miss a default argument (on the right<br>
line)<br>
<br>
What is still not working is this:<br>
<br>
template <int, int =0> struct p { const static int w = 0; };<br>
struct T {<br>
     int i = p<0,  p<a<b>::w  >::w, p<0>::*j;<br>
     static const int a = 1, b = 2;<br>
};<br>
<br>
because a and b are declare after, and the TryAnnotateCXXScopeToken will<br>
display error as a and b are not defined yet.<br>
<br>
But clang did not accept this code before.  And gcc also seems to have a bug<br>
there.<br>
<div class="im"><br>
<br>
> > Also a template argument can contains = for example in this case:<br>
> >  struct S {constexpr S(){}; constexpr int operator=(int) const {return<br>
> >  5;}};<br>
> >  template <int> struct A {};<br>
> >  constexpr S s;<br>
> >  A<s=4> a;<br>
><br>
> This is ill-formed.<br>
<br>
</div>Why?<br>
the operator= is a constexpr</blockquote><div><br></div><div>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].</div><div>
<br></div><div>-Eli </div></div></div></div>