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

            Bug ID: 101509
           Summary: Rejects valid construction call with type inference
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gar...@ignition-web.co.uk
  Target Milestone: ---

template <typename T>
struct S { S(T); };

struct my_type{ my_type(S<int>); };

void foo(S<int>);

void test()
{
    my_type(S(1)); // no issue here
    my_type(S{1}); // no issue here
    auto tmp1 = my_type(S(1)); // no issue here
    auto tmp2 = my_type(S{1}); // no issue here
    foo(S(1)); // no issue here
    foo(S{1}); // no issue here
    my_type tmp3(S(1)); // no issue here
    my_type tmp4(S{1}); // GCC error
    my_type tmp5((S{1})); // no issue here
}

https://godbolt.org/z/jb68o46fP

Reply via email to