This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/78073] New: inherited initializer_list constructor is not accessible


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

            Bug ID: 78073
           Summary: inherited initializer_list constructor is not
                    accessible
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ryan.burn at gmail dot com
  Target Milestone: ---

The below code should compile but gives this error with g++ built from trunk
(20161022).

main.cpp: In function ‘int main()’:
main.cpp:12:13: error: could not convert ‘2.0e+0’ from ‘double’ to ‘A’
   B b = {2.0};
             ^


////////////////////////////////////////////////////////////////////////////
#include <initializer_list>

struct A {
  A(std::initializer_list<double>) {}
};

struct B : A {
  using A::A;
};

int main() {
  B b = {2.0};
  return 0;
}
////////////////////////////////////////////////////////////////////////////

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]