g++ 2.95.2 fails to detect ambiguity between member and non-member

Martin Sebor sebor@roguewave.com
Fri Mar 24 09:40:00 GMT 2000


"Martin v. Loewis" wrote:
> 
> > Hence, according to 13.3.3, p2, the call is ill-formed.
> 
> Thanks for your bug report. It' not a bug, it's a feature :-) With
> -pedantic, g++ says
> 
> a.cc: In function `int main()':
> a.cc:17: ambiguous overload for `!S'
> a.cc:3: candidates are: int S::operator !() const
> a.cc:10:                 int operator !(const S &)
> 
> To provide better compatibility with the ARM rules, g++ accepts code
> which is pedantically ill-formed. This is designed as an extension,
> i.e. the rules should never result well-formed code being interpreted
> differently.

Thanks for the clarification - I didn't realize the ARM allowed this.
Martin


> 
> Regards,
> Martin


More information about the Gcc-bugs mailing list