This is the mail archive of the gcc-help@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]

Re: ADL Help


Hi Perry,

> It seems like the "here 1" version would be found but it is not.  Can
> you help me to understand what I'm missing?

If you change main to...

int main() {
  parm.f(parm);
  return 0;
}

...or (recommended)...

int main() {
  NS::T::f(parm);
  return 0;
}

...then "here 1" will be used.

I was surprised to see that ungarnished f(parm) used NS::f without having to
specify NS:: or using namespace NS or using NS::f ... that smells like a bug
in the compiler.

But I'm not using the most current GCC release right now, so if it is a
bug*, maybe it's been fixed in the current GCC.

HTH,
--Eljay

* perhaps it's not a bug, and I'm mistaken (and surprised)


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