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

            Bug ID: 90210
           Summary: [C++17] CTAD forbidding explicit deduction guide for
                    copy-list-initialization
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tyker at outlook dot com
  Target Milestone: ---

gcc currently allows the following code:

template<typename T> struct tuple { tuple(T); };
template<typename T> explicit tuple(T t) -> tuple<T>;
tuple t = { 1 };

this should fail to compile because the deduction guide is marked explicit.
the issue may come from the implicit deduction guide not being overridden by
the user defined one.

example from other compilers:
https://godbolt.org/z/M198L5

the standard says in [over.match.list]:
"In copy-list-initialization, if an explicit constructor is chosen, the
initialization is ill-formed."

Reply via email to