This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14790] C++: ambigous overload compile failure - new case different from 1675
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Mar 2004 23:53:34 -0000
- Subject: [Bug c++/14790] C++: ambigous overload compile failure - new case different from 1675
- References: <20040330234533.14790.osf@squirrely.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-03-30 23:53 -------
With this stripped down (equivalent) program
------------------
struct base1 { void foo(base1*); };
struct base2 { void foo(base2*); };
struct derived : public base1, public base2 {};
int main() {
derived fd;
fd.foo(new base1());
}
-------------------
I get errors with both gcc and icc:
g/x> c++ -c x.cc
x.cc: In function `int main()':
x.cc:8: error: request for member `foo' is ambiguous
x.cc:2: error: candidates are: void base2::foo(base2*)
x.cc:1: error: void base1::foo(base1*)
g/x> icc -c -Xc -ansi x.cc
x.cc(8): error: "derived::foo" is ambiguous
fd.foo(new base1());
^
compilation aborted for x.cc (code 2)
I am pretty sure the code is invalid, but someone may be able to cite
the relevant paragraphs.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14790