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]

ambiguous ambiguous error...



Hi,

I'm playing with namespaces, and I did make a mistake. However the
error message that I receive is ambiguous. i.e. it doesn't help me
much. 

namespace Phil {
  int f() ;
}

using namespace Phil ;

int f() { ; }  // mistake is here should have been int Phil::f() { ; }



int g() {
  return f() ;
}


And the output is

> c++ -c name.cc
name.cc: In function `int g()':
name.cc:14: call of overloaded `f ()' is ambiguous
name.cc:9: candidates are: f()
name.cc:4:                 f()


Since I just got burned by this error and someone from this list
kindly told me about it I know know that the ambiguous call is between
Phil::f() and f().

However egcs1.1b doesn't give me that information (which it obviously
knows about since it generated an ambiguous call). 

I don't know if this is a bug or not, but I think it would help
newbies a lot if this was more explicit, i.e.

name.cc: In function `int g()':
name.cc:14: call of overloaded `f ()' is ambiguous
name.cc:9: candidates are: f()
name.cc:4:                 Phil::f()


Have fun.

Phil


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