This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/46626] [4.6 Regression] simple use of virtual methods causes pure virtual method call in c++0x mode
- From: "roman at binarylife dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 25 Dec 2010 01:49:16 +0000
- Subject: [Bug c++/46626] [4.6 Regression] simple use of virtual methods causes pure virtual method call in c++0x mode
- Auto-submitted: auto-generated
- References: <bug-46626-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46626
--- Comment #8 from Roman Kononov <roman at binarylife dot net> 2010-12-25 01:49:05 UTC ---
With the patch applied to r168236:
$ cat test.cpp
struct X {
virtual int& x(int&)=0;
virtual ~X() {}
};
struct Y {
virtual int& y(int&)=0;
virtual ~Y() {}
};
struct Z: X, Y {
int& x(int&);
int& y(int&);
};
void func() {
Z z;
}
$ g++ -c -std=c++0x test.cpp
test.cpp: In function 'void func()':
test.cpp:17:7: in constexpr expansion of 'z.Z::Z()'
test.cpp:17:7: internal compiler error: in cxx_eval_bare_aggregate, at
cp/semantics.c:6352
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Without the patch, with the same test.cpp:
$ g++ -c -std=c++0x test.cpp; echo $?
0
Without the patch, with slightly different test1.cpp:
0 rk@wata:~/tmp/qqq>cat test1.cpp
struct X {
virtual int& x(int&)=0;
// virtual ~X() {}
};
struct Y {
virtual int& y(int&)=0;
// virtual ~Y() {}
};
struct Z: X, Y {
int& x(int&);
int& y(int&);
};
void func() {
Z z;
}
0 rk@wata:~/tmp/qqq>g++ -c -std=c++0x test1.cpp
test1.cpp: In function 'void func()':
test1.cpp:17:7: in constexpr expansion of 'z.Z::Z()'
test1.cpp:17:7: internal compiler error: in cxx_eval_bare_aggregate, at
cp/semantics.c:6338
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.