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

            Bug ID: 94885
           Summary: Functional cast from int to empty class incorrectly
                    accepted with -std=c++2a
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppalka at gcc dot gnu.org
  Target Milestone: ---

The following testcase

template <typename T, typename = decltype(T(0))>
void foo();

struct base {};
struct derived : base {};

void
bar()
{
  foo<derived>();
}

is rejected by GCC 9 (with both -std=c++17 and -std=c++2a) and rejected by GCC
10 with -std=c++17, but it's accepted by GCC 10 with -std=c++2a.

Reply via email to