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]

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


> 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

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