This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67810] New: Non-expression recognized as fold expression


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67810

            Bug ID: 67810
           Summary: Non-expression recognized as fold expression
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Casey at Carter dot net
  Target Milestone: ---

r228351 fails to compile this correct program:

template <class...>
constexpr bool Test = true;

template <typename...Ts, bool = (Test<Ts&&...>)>
void f();

with error:

~/gcc6-r228351/bin/g++ -std=c++14 -c foo.cpp 
foo.cpp:4:41: warning: fold-expressions only available with -std=c++1z or
-std=gnu++1z
 template <typename...Ts, bool = (Test<Ts&&...>)>
                                         ^
foo.cpp:4:47: error: expected binary operator before â)â token
 template <typename...Ts, bool = (Test<Ts&&...>)>
                                               ^
foo.cpp:5:1: error: expected primary-expression before âvoidâ
 void f();
 ^
foo.cpp:5:1: error: expected â>â before âvoidâ
foo.cpp:5:9: error: expected unqualified-id before â;â token
 void f();
         ^

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]