This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++ 2.95.2 fails to detect ambiguity between member and non-member
- To: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Subject: Re: g++ 2.95.2 fails to detect ambiguity between member and non-member
- From: Martin Sebor <sebor at roguewave dot com>
- Date: Fri, 24 Mar 2000 10:45:08 -0700
- CC: gcc-bugs at gcc dot gnu dot org, pedretti at roguewave dot com
- References: <38DADF66.91DC5667@roguewave.com> <200003240800.JAA00535@loewis.home.cs.tu-berlin.de>
"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