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++/14790] C++: ambigous overload compile failure - new case different from 1675


------- 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


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