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

            Bug ID: 79143
           Summary: [7 Regression][new inheriting constructors] inheriting
                    constructor fails with brace initialization
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Casey at Carter dot net
  Target Milestone: ---

r244608 with -std=c++1z fails to compile this program both with and without
-fno-new-inheriting-constructors:

struct base {
  base(int, int) {}
};

template<class>
struct derived : base {
  using base::base;
};

int main() {
  base(13, 42); // Fine
  derived<int>(13, 42); // Fine
  base{13, 42}; // Fine
  derived<int>{13, 42}; // Error
}

with diagnostics:

prog.cc: In function 'int main()':
prog.cc:14:22: error: too many initializers for 'derived<int>'
   derived<int>{13, 42}; // Error
                      ^
prog.cc:14:22: error: could not convert '13' from 'int' to 'base'

Reply via email to