https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70163
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-05-19
CC| |msebor at gcc dot gnu.org
Ever confirmed|0 |1
Known to fail| |4.9.3, 5.3.0, 6.1.0, 7.0
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed with today's trunk (7.0) and prior released versions. Clang ineeds
accepts it, EDG 4.10 does not.
$ cat u.cpp && /build/gcc-trunk-svn/gcc/xgcc -B /build/gcc-trunk-svn/gcc -S
-Wall -Wextra -Wpedantic u.cpp
struct A {
A(const int i, const int j) {};
};
struct B1 : virtual public A {
virtual void moo()=0;
B1() {}; // (1) Look! not "B1() : A(5,6) {};"
};
struct B2 : virtual public A {
virtual void cow()=0;
B2() {}; // (2) Look! not "B2() : A(7,8) {};"
};
struct C : public B1, public B2 {
C() : A(2,3) {};
void moo() {};
void cow() {};
};
int main() {
C c;
return 0;
};
u.cpp: In constructor ‘A::A(int, int)’:
u.cpp:2:15: warning: unused parameter ‘i’ [-Wunused-parameter]
A(const int i, const int j) {};
^
u.cpp:2:28: warning: unused parameter ‘j’ [-Wunused-parameter]
A(const int i, const int j) {};
^
u.cpp: In constructor ‘B1::B1()’:
u.cpp:7:8: error: no matching function for call to ‘A::A()’
B1() {}; // (1) Look! not "B1() : A(5,6) {};"
^
u.cpp:2:3: note: candidate: A::A(int, int)
A(const int i, const int j) {};
^
u.cpp:2:3: note: candidate expects 2 arguments, 0 provided
u.cpp:1:8: note: candidate: constexpr A::A(const A&)
struct A {
^
u.cpp:1:8: note: candidate expects 1 argument, 0 provided
u.cpp:1:8: note: candidate: constexpr A::A(A&&)
u.cpp:1:8: note: candidate expects 1 argument, 0 provided
u.cpp: In constructor ‘B2::B2()’:
u.cpp:12:8: error: no matching function for call to ‘A::A()’
B2() {}; // (2) Look! not "B2() : A(7,8) {};"
^
u.cpp:2:3: note: candidate: A::A(int, int)
A(const int i, const int j) {};
^
u.cpp:2:3: note: candidate expects 2 arguments, 0 provided
u.cpp:1:8: note: candidate: constexpr A::A(const A&)
struct A {
^
u.cpp:1:8: note: candidate expects 1 argument, 0 provided
u.cpp:1:8: note: candidate: constexpr A::A(A&&)
u.cpp:1:8: note: candidate expects 1 argument, 0 provided
u.cpp: At global scope:
u.cpp:24:2: warning: extra ‘;’ [-Wpedantic]
};
^