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: sebor at roguewave dot com
- Subject: Re: g++ 2.95.2 fails to detect ambiguity between member and non-member
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Fri, 24 Mar 2000 09:00:10 +0100
- CC: gcc-bugs at gcc dot gnu dot org, pedretti at roguewave dot com
- References: <38DADF66.91DC5667@roguewave.com>
> 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.
Regards,
Martin