This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78073] New: inherited initializer_list constructor is not accessible
- From: "ryan.burn at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 22 Oct 2016 03:12:04 +0000
- Subject: [Bug c++/78073] New: inherited initializer_list constructor is not accessible
- Auto-submitted: auto-generated
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;
}
////////////////////////////////////////////////////////////////////////////