On Tue, May 03, 2022 at 04:26:51PM -0400, Jason Merrill wrote:
> On 5/2/22 12:19, Marek Polacek wrote:
> > This patch fixes an oversight whereby we treated >= as the end of
> > a template argument.  This causes problems in C++14, because in
> > cp_parser_template_argument we go different ways for C++14 and C++17:
> > 
> >    /* It must be a non-type argument.  In C++17 any constant-expression is
> >       allowed.  */
> >    if (cxx_dialect > cxx14)
> >      goto general_expr;
> > 
> > so in this testcase in C++14 we get "N" as the template argument but in
> > C++17 it is the whole "N >= 5" expression.  So in C++14 the remaining
> > ">= 5" triggered the newly-added diagnostic.
> 
> Hmm, I think >>= is questionable as well, as it could resolve to a constexpr
> operator>>=.  Seems like the two calls to

The template argument is a constant-expression and >>= can't appear non-nested
in constant-expression non-terminal, can it?
>= certainly can.

        Jakub

Reply via email to