public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function"
       [not found] <bug-24702-4@http.gcc.gnu.org/bugzilla/>
@ 2013-09-05 14:29 ` paolo.carlini at oracle dot com
  2013-09-05 14:40 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-09-05 14:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24702

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|gcc-bugs at gcc dot gnu.org        |

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Gaby, can you help me with this old issue? I can't find any DR still open in
this area, and we behave exactly like current clang & icc, that is we reject
the last three lines (about unqualified dummyFunct, myDummyFunct, and
mymyDummyFunct). Can we resolve this bug?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function"
       [not found] <bug-24702-4@http.gcc.gnu.org/bugzilla/>
  2013-09-05 14:29 ` [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function" paolo.carlini at oracle dot com
@ 2013-09-05 14:40 ` redi at gcc dot gnu.org
  2013-09-05 14:43 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2013-09-05 14:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24702

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The standard says:

When considering an associated namespace, the lookup is the same as the lookup
performed when the associated namespace is used as a qualifier (3.4.3.2) except
that:
- [...]
- [...]
- All names except those of (possibly overloaded) functions and function
templates are ignored.

So non-functions are ignored.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function"
       [not found] <bug-24702-4@http.gcc.gnu.org/bugzilla/>
  2013-09-05 14:29 ` [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function" paolo.carlini at oracle dot com
  2013-09-05 14:40 ` redi at gcc dot gnu.org
@ 2013-09-05 14:43 ` redi at gcc dot gnu.org
  2013-09-05 15:18 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2013-09-05 14:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24702

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
See http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#218 for the
rationale.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function"
       [not found] <bug-24702-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2013-09-05 14:43 ` redi at gcc dot gnu.org
@ 2013-09-05 15:18 ` paolo.carlini at oracle dot com
  2013-09-06  1:19 ` pierhyth at gmail dot com
  2013-09-06  7:30 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-09-05 15:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24702

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Thanks Jon!


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function"
       [not found] <bug-24702-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2013-09-05 15:18 ` paolo.carlini at oracle dot com
@ 2013-09-06  1:19 ` pierhyth at gmail dot com
  2013-09-06  7:30 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 10+ messages in thread
From: pierhyth at gmail dot com @ 2013-09-06  1:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24702

--- Comment #9 from Mark Phillips <pierhyth at gmail dot com> ---
Thanks Jonathan for the information on the updated standard and the rationale
behind restricting Koenig to actual functions and function templates.

In one way it is a bit of a pity - it does make functors second-class citizens
compared to functions - but the linked document explains some additional
considerations, namely the risk of over-visibility of names.  Perhaps it is a
reasonable choice for now.  Hopefully a better solution will be introduced down
the track (maybe extending it to functors, while at the same time
narrowing/allowing-control-over namespaces to be looked up).


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function"
       [not found] <bug-24702-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2013-09-06  1:19 ` pierhyth at gmail dot com
@ 2013-09-06  7:30 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2013-09-06  7:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24702

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I wouldn't hold your breath unfortunately. There are at least two opposing
views on how to "fix" ADL within the standard committee and no consensus on
what (if anything) should be done.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function"
  2005-11-07  7:09 [Bug c++/24702] New: " pierhyth at gmail dot com
                   ` (2 preceding siblings ...)
  2005-11-16 19:28 ` gdr at integrable-solutions dot net
@ 2005-12-04  5:09 ` gdr at gcc dot gnu dot org
  3 siblings, 0 replies; 10+ messages in thread
From: gdr at gcc dot gnu dot org @ 2005-12-04  5:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from gdr at gcc dot gnu dot org  2005-12-04 05:09 -------
this issue should be resolved one way of the other based on the
core issue about argument dependent lookup specification, when a
non-function is found.  The "obvious" solution would be to do overload
resolution based on the signatures (whether actual function, constructor, 
function objects, or references to those).  However, all that needs
tracking the open core issue.


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gdr at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-12-04 05:09:46
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24702


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function"
  2005-11-07  7:09 [Bug c++/24702] New: " pierhyth at gmail dot com
  2005-11-07 13:37 ` [Bug c++/24702] " pinskia at gcc dot gnu dot org
  2005-11-09  1:33 ` pierhyth at gmail dot com
@ 2005-11-16 19:28 ` gdr at integrable-solutions dot net
  2005-12-04  5:09 ` gdr at gcc dot gnu dot org
  3 siblings, 0 replies; 10+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-11-16 19:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from gdr at integrable-solutions dot net  2005-11-16 19:28 -------
Subject: Re:  Koenig found functoid ref, but "cannot be used as a function"

"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Actually IIRC Koenig lookup only finds functions and not variables. 

That is incorrect.  There is an active core language issue on
"argument dependent name lookup specification."

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24702


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function"
  2005-11-07  7:09 [Bug c++/24702] New: " pierhyth at gmail dot com
  2005-11-07 13:37 ` [Bug c++/24702] " pinskia at gcc dot gnu dot org
@ 2005-11-09  1:33 ` pierhyth at gmail dot com
  2005-11-16 19:28 ` gdr at integrable-solutions dot net
  2005-12-04  5:09 ` gdr at gcc dot gnu dot org
  3 siblings, 0 replies; 10+ messages in thread
From: pierhyth at gmail dot com @ 2005-11-09  1:33 UTC (permalink / raw)
  To: gcc-bugs



------- 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
to functoids/functors.

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.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24702


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function"
  2005-11-07  7:09 [Bug c++/24702] New: " pierhyth at gmail dot com
@ 2005-11-07 13:37 ` pinskia at gcc dot gnu dot org
  2005-11-09  1:33 ` pierhyth at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-07 13:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-11-07 13:36 -------
Actually IIRC Koenig lookup only finds functions and not variables.  If that is
the case we have two issues here.  One is we accept invalid and another is that
error message is wrong.

Note ICC rejects this:
t.cc(26): error: identifier "dummyFunct" is undefined
    std::cout<<"dummyFunct(d) = "<<dummyFunct(d)<<std::endl; // fails with 3.4
                                   ^

t.cc(28): error: identifier "myDummyFunct" is undefined
    std::cout<<"myDummyFunct(d) = "<<myDummyFunct(d)<<std::endl;
                                     ^

t.cc(29): error: identifier "mymyDummyFunct" is undefined
    std::cout<<"mymyDummyFunct(d) = "<<mymyDummyFunct(d)<<std::endl; // fails
                                       ^


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24702


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-09-06  7:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-24702-4@http.gcc.gnu.org/bugzilla/>
2013-09-05 14:29 ` [Bug c++/24702] Koenig found functoid ref, but "cannot be used as a function" paolo.carlini at oracle dot com
2013-09-05 14:40 ` redi at gcc dot gnu.org
2013-09-05 14:43 ` redi at gcc dot gnu.org
2013-09-05 15:18 ` paolo.carlini at oracle dot com
2013-09-06  1:19 ` pierhyth at gmail dot com
2013-09-06  7:30 ` redi at gcc dot gnu.org
2005-11-07  7:09 [Bug c++/24702] New: " pierhyth at gmail dot com
2005-11-07 13:37 ` [Bug c++/24702] " pinskia at gcc dot gnu dot org
2005-11-09  1:33 ` pierhyth at gmail dot com
2005-11-16 19:28 ` gdr at integrable-solutions dot net
2005-12-04  5:09 ` gdr at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).