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

            Bug ID: 79316
           Summary: Default parameter values in explicit deduction guides
                    do not work
           Product: gcc
           Version: 7.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mike at spertus dot com
  Target Milestone: ---

When I compile the following code with gcc-7-20170122,

  template<typename T> struct S { S(T t) {} };
  template<typename T> S(T, int = 7) -> S<T>;

I get the following error

  error: default arguments are only permitted for function parameters
[-fpermissive]

I believe that the above code should be correct as deduction-guides accept a
parameter-declaration-clause, which can have default argument values. In
addition, P0433R0 contains examples of deduction guides with default arguments
(e.g., for deque).

Reply via email to