public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11786] New: operator() call on variable in other namespace not recognized
@ 2003-08-04  6:32 gccbugs at contacts dot eelis dot net
  2003-08-04  7:28 ` [Bug c++/11786] " gccbugs at contacts dot eelis dot net
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gccbugs at contacts dot eelis dot net @ 2003-08-04  6:32 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: operator() call on variable in other namespace not
                    recognized
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gccbugs at contacts dot eelis dot net
                CC: gcc-bugs at gcc dot gnu dot org

GCC rejects the following valid code:

  struct S
  {
    template <typename T> void operator() (T) {}
  };

  namespace N
  {
    S s;
    struct A {} a;
  }

  using N::s;

  void f () { s(N::a); }

GCC says:

  t.cpp:8: error: `N::s' is not a function,
  t.cpp:8: error:   conflict with `N::s'
  t.cpp:14: error:   in call to `s'

My best guess would be that GCC does not recognize s(..) as a call to operator()
on _variable_ N::s, and as such insists on finding a _function_ named 'N::s'. I
haven't got a clue as to what the rest of the error message indicates or how A
is involved.

Comeau compiles the code without problems.

I'm using GCC 3.4 20030723.


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

* [Bug c++/11786] operator() call on variable in other namespace not recognized
  2003-08-04  6:32 [Bug c++/11786] New: operator() call on variable in other namespace not recognized gccbugs at contacts dot eelis dot net
@ 2003-08-04  7:28 ` gccbugs at contacts dot eelis dot net
  2003-08-04 19:46 ` pinskia at physics dot uc dot edu
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: gccbugs at contacts dot eelis dot net @ 2003-08-04  7:28 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From gccbugs at contacts dot eelis dot net  2003-08-04 07:28 -------
Simplified snippet:

  namespace N
  {
    struct A {};
    struct S { void operator() (A); } s;
  }

  using N::s;

  void f () { s(N::A()); }


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

* [Bug c++/11786] operator() call on variable in other namespace not recognized
  2003-08-04  6:32 [Bug c++/11786] New: operator() call on variable in other namespace not recognized gccbugs at contacts dot eelis dot net
  2003-08-04  7:28 ` [Bug c++/11786] " gccbugs at contacts dot eelis dot net
@ 2003-08-04 19:46 ` pinskia at physics dot uc dot edu
  2003-08-04 23:02 ` [Bug c++/11786] [3.3/3.4 regression] " reichelt at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-04 19:46 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-04 19:46:42
               date|                            |


------- Additional Comments From pinskia at physics dot uc dot edu  2003-08-04 19:46 -------
I can confirm this on the mainline (20030804).  ICC 6.0 in strict mode (-Xc) accepts this 
code.


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

* [Bug c++/11786] [3.3/3.4 regression] operator() call on variable in other namespace not recognized
  2003-08-04  6:32 [Bug c++/11786] New: operator() call on variable in other namespace not recognized gccbugs at contacts dot eelis dot net
  2003-08-04  7:28 ` [Bug c++/11786] " gccbugs at contacts dot eelis dot net
  2003-08-04 19:46 ` pinskia at physics dot uc dot edu
@ 2003-08-04 23:02 ` reichelt at gcc dot gnu dot org
  2003-09-08 18:46 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2003-08-04 23:02 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
           Keywords|                            |monitored
           Priority|P2                          |P1
            Summary|operator() call on variable |[3.3/3.4 regression]
                   |in other namespace not      |operator() call on variable
                   |recognized                  |in other namespace not
                   |                            |recognized
   Target Milestone|3.4                         |3.3.2


------- Additional Comments From reichelt at gcc dot gnu dot org  2003-08-04 23:02 -------
gcc 2.95.x compiled the code. It is rejected since gcc 3.0.


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

* [Bug c++/11786] [3.3/3.4 regression] operator() call on variable in other namespace not recognized
  2003-08-04  6:32 [Bug c++/11786] New: operator() call on variable in other namespace not recognized gccbugs at contacts dot eelis dot net
                   ` (2 preceding siblings ...)
  2003-08-04 23:02 ` [Bug c++/11786] [3.3/3.4 regression] " reichelt at gcc dot gnu dot org
@ 2003-09-08 18:46 ` cvs-commit at gcc dot gnu dot org
  2003-09-08 19:05 ` cvs-commit at gcc dot gnu dot org
  2003-09-08 19:15 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-09-08 18:46 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-09-08 18:46 -------
Subject: Bug 11786

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2003-09-08 18:46:20

Modified files:
	gcc/cp         : ChangeLog decl2.c semantics.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/lookup: koenig2.C 

Log message:
	PR c++/11786
	* decl2.c (add_function): Do not complain about seeing the same
	non-function twice.
	* semantics.c (perform_koenig_lookup): Improve documentation.
	
	PR c++/11786
	* g++.dg/lookup/koenig2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3661&r2=1.3662
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.669&r2=1.670
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.357&r2=1.358
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3041&r2=1.3042
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/koenig2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1


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

* [Bug c++/11786] [3.3/3.4 regression] operator() call on variable in other namespace not recognized
  2003-08-04  6:32 [Bug c++/11786] New: operator() call on variable in other namespace not recognized gccbugs at contacts dot eelis dot net
                   ` (3 preceding siblings ...)
  2003-09-08 18:46 ` cvs-commit at gcc dot gnu dot org
@ 2003-09-08 19:05 ` cvs-commit at gcc dot gnu dot org
  2003-09-08 19:15 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-09-08 19:05 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-09-08 19:05 -------
Subject: Bug 11786

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	mmitchel@gcc.gnu.org	2003-09-08 19:05:44

Modified files:
	gcc/cp         : ChangeLog decl2.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/lookup: koenig2.C 

Log message:
	PR c++/11786
	* decl2.c (add_function): Do not complain about seeing the same
	non-function twice.
	
	PR c++/11786
	* g++.dg/lookup/koenig2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.203&r2=1.3076.2.204
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.575.2.34&r2=1.575.2.35
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.275&r2=1.2261.2.276
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/koenig2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1


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

* [Bug c++/11786] [3.3/3.4 regression] operator() call on variable in other namespace not recognized
  2003-08-04  6:32 [Bug c++/11786] New: operator() call on variable in other namespace not recognized gccbugs at contacts dot eelis dot net
                   ` (4 preceding siblings ...)
  2003-09-08 19:05 ` cvs-commit at gcc dot gnu dot org
@ 2003-09-08 19:15 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2003-09-08 19:15 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


mmitchel at gcc dot gnu dot org changed:

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


------- Additional Comments From mmitchel at gcc dot gnu dot org  2003-09-08 19:15 -------
Fixed in GCC 3.3.2, GCC 3.4.


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

end of thread, other threads:[~2003-09-08 19:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-04  6:32 [Bug c++/11786] New: operator() call on variable in other namespace not recognized gccbugs at contacts dot eelis dot net
2003-08-04  7:28 ` [Bug c++/11786] " gccbugs at contacts dot eelis dot net
2003-08-04 19:46 ` pinskia at physics dot uc dot edu
2003-08-04 23:02 ` [Bug c++/11786] [3.3/3.4 regression] " reichelt at gcc dot gnu dot org
2003-09-08 18:46 ` cvs-commit at gcc dot gnu dot org
2003-09-08 19:05 ` cvs-commit at gcc dot gnu dot org
2003-09-08 19:15 ` mmitchel 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).