[Bug c++/71141] New: [concepts] Example variadic concept code in the Concepts TS 14.1p9.4 rejected

tom at honermann dot net gcc-bugzilla@gcc.gnu.org
Mon May 16 04:20:00 GMT 2016


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

            Bug ID: 71141
           Summary: [concepts] Example variadic concept code in the
                    Concepts TS 14.1p9.4 rejected
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tom at honermann dot net
                CC: andrew.n.sutton at gmail dot com, asutton at gcc dot gnu.org
  Target Milestone: ---

The following test case is taken from example code in the Concepts TS § 14.1
p9.4.  gcc r236238 rejects this code.  I presume the code is intended to be
well-formed; if not, then the Concepts TS should be updated.

$ cat t1.cpp
template<typename... Ts> concept bool C4 = true;
template<C4 T> void f5(); 

$ g++ -c -std=c++1z -fconcepts t1.cpp
t1.cpp:2:14: error: variadic constraint introduced without ‘...’ before ‘>’
token
 template<C4 T> void f5();
              ^

The example is accepted if the constrained function is re-written with a
requires clause:

$ cat t2.cpp
template<typename... Ts> concept bool C4 = true;
template<typename T> requires C4<T> void f5(); 

$ g++ -c -std=c++1z -fconcepts t2.cpp; echo $?
0

An error is similarly produced when using a variadic non-type concept:

$ cat t3.cpp
template<char... Cs> concept bool C5 = true;
template<C5 C> void f7();

$ g++ -c -std=c++1z -fconcepts t3.cpp
t3.cpp:2:14: error: variadic constraint introduced without ‘...’ before ‘>’
token
 template<C5 C> void f7();
              ^


More information about the Gcc-bugs mailing list