On Wed, Dec 03, 2014 at 02:45:50PM +0100, Andreas Schwab wrote:
> Marek Polacek writes:
>
> > * constexpr.c (cxx_eval_check_shift_p): New function.
> > (cxx_eval_binary_expression): Call it. Set NON_CONSTANT_P if it
> > returns true.
> >
> > * g++.dg/cpp0x/constexpr-shift1.C: New
Marek Polacek writes:
> * constexpr.c (cxx_eval_check_shift_p): New function.
> (cxx_eval_binary_expression): Call it. Set NON_CONSTANT_P if it
> returns true.
>
> * g++.dg/cpp0x/constexpr-shift1.C: New test.
> * g++.dg/cpp1y/constexpr-shift1.C: New test.
> *
OK, thanks.
Jason
On Tue, Dec 02, 2014 at 09:59:26AM -0500, Jason Merrill wrote:
> Thanks. These errors also need to be conditional on (!ctx->quiet), and if
> we see one of these conditions we need to set *non_constant_p.
Ah, sorry. Fixed in the following.
Regtested on ppc64-linux, bootstrap in progress.
2014-1
On 12/02/2014 09:14 AM, Marek Polacek wrote:
On Fri, Nov 28, 2014 at 09:28:03AM -0500, Jason Merrill wrote:
I was thinking even more detailed: one diagnostic for negative count, one
diagnostic for count larger than the precision of the lhs, and then a third
for overflow.
Alright, done.
Thank
On Fri, Nov 28, 2014 at 09:28:03AM -0500, Jason Merrill wrote:
> I was thinking even more detailed: one diagnostic for negative count, one
> diagnostic for count larger than the precision of the lhs, and then a third
> for overflow.
Alright, done.
> >+ /* For signed x << y the following:
>
On 11/27/2014 09:26 AM, Marek Polacek wrote:
On Wed, Nov 26, 2014 at 11:56:26AM -0500, Jason Merrill wrote:
Please give diagnostics explaining what's wrong with the shift rather than
the generic "is not a constant expression".
Done.
I was thinking even more detailed: one diagnostic for negat
On Wed, Nov 26, 2014 at 11:56:26AM -0500, Jason Merrill wrote:
> Please give diagnostics explaining what's wrong with the shift rather than
> the generic "is not a constant expression".
Done.
> >+ tree t = build_int_cst (unsigned_type_node, uprec - 1);
> >+ t = fold_build2 (MINUS_EXPR,
Please give diagnostics explaining what's wrong with the shift rather
than the generic "is not a constant expression".
+ tree t = build_int_cst (unsigned_type_node, uprec - 1);
+ t = fold_build2 (MINUS_EXPR, unsigned_type_node, t, rhs);
+ tree ulhs = fold_convert (unsigned_type_f
On Mon, Nov 24, 2014 at 05:05:08PM +0100, Jakub Jelinek wrote:
> On Mon, Nov 24, 2014 at 04:58:22PM +0100, Marek Polacek wrote:
> > > Consider say:
> > >
> > > constexpr int p = 1;
> > > constexpr int foo (int a)
> > > {
> > > return a << (int) &p;
> > > }
> > > constexpr int bar (int a)
> > > {
On Mon, Nov 24, 2014 at 04:58:22PM +0100, Marek Polacek wrote:
> > Consider say:
> >
> > constexpr int p = 1;
> > constexpr int foo (int a)
> > {
> > return a << (int) &p;
> > }
> > constexpr int bar (int a)
> > {
> > return ((int) &p) << a;
> > }
> > constexpr int q = foo (5);
> > constexpr i
On Mon, Nov 24, 2014 at 04:49:25PM +0100, Jakub Jelinek wrote:
> On Mon, Nov 24, 2014 at 02:51:14PM +0100, Marek Polacek wrote:
> > --- gcc/cp/constexpr.c
> > +++ gcc/cp/constexpr.c
> > @@ -1451,6 +1451,43 @@ verify_constant (tree t, bool allow_non_constant,
> > bool *non_constant_p,
> >return
On Mon, Nov 24, 2014 at 02:51:14PM +0100, Marek Polacek wrote:
> --- gcc/cp/constexpr.c
> +++ gcc/cp/constexpr.c
> @@ -1451,6 +1451,43 @@ verify_constant (tree t, bool allow_non_constant, bool
> *non_constant_p,
>return *non_constant_p;
> }
>
> +/* Return true if the shift operation on LHS
13 matches
Mail list logo