[Bug c++/77927] unary right fold fails to compile

2016-11-15 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77927

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||trippels at gcc dot gnu.org
 Resolution|--- |DUPLICATE

--- Comment #5 from Markus Trippelsdorf  ---
dup.

*** This bug has been marked as a duplicate of bug 68377 ***

[Bug c++/77927] unary right fold fails to compile

2016-10-12 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77927

Ville Voutilainen  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-10-12
 CC||jason at redhat dot com,
   ||ville.voutilainen at gmail dot 
com
 Ever confirmed|0   |1

--- Comment #4 from Ville Voutilainen  ---
Clang accepts the code.

[Bug c++/77927] unary right fold fails to compile

2016-10-10 Thread jeff.mirwaisi at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77927

--- Comment #3 from Jeff Mirwaisi  ---
Apologies for the poor bug report, to clarify, unary right folds which use a
binary 
operator in the fold parameter are failing to compile:

( (x op1 y) op2... );

//clearer examples - error: binary expression in operand of fold-expression
template void f1(){ ((N+1)+...); }
template void f2(){ ((1+N),...); }  
template void f3(){ ((N-1)*...); }

//op1 and op2 do not have to be the same operator

//the corresponding left folds compile as expected:
template void f4(){ (...+(1+N)); }

[Bug c++/77927] unary right fold fails to compile

2016-10-10 Thread jeff.mirwaisi at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77927

--- Comment #2 from Jeff Mirwaisi  ---
//error: binary expression in operand of fold-expression

[Bug c++/77927] unary right fold fails to compile

2016-10-10 Thread jeff.mirwaisi at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77927

--- Comment #1 from Jeff Mirwaisi  ---
//unary right fold fails to compile
template void f(){int A[]={(((void)N,int()),...)};}

//corresponding left fold works as expected
template void f(){int A[]={(...,((void)N,int()))};}

//both are simple tests that generate a single element array int A[1]={0}