This is the mail archive of the
mailing list for the GCC project.
[Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function"
- From: "pierhyth at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Nov 2005 01:33:19 -0000
- Subject: [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function"
- References: <email@example.com/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from pierhyth at gmail dot com 2005-11-09 01:33 -------
The current C++ standard says that Koenig applies "when an unqualified
name is used as the postfix-expression in a function call" which from
what I've read, must include the case of functoids/functors and references
It is true that some people seem to be arguing that the standard be changed
to restrict Koenig to only functions, a view which seems to me rather
unfortunate. However the fact remains that the current standard allows
functors and the g++ compiler complies with this by allowing functors.
The issue is that references to functors appear to be broken in the most
recent versions of g++.
I have written much code that relies on g++ finding references to functors
through Koenig lookup. This code compiled fine with version 3.2. The
problem only arose when I tried to update to the 4.0 compiler.