public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11988] New: Using "using" in two-stage name lookup
@ 2003-08-20  5:28 derrick at cco dot caltech dot edu
  2003-08-20  6:21 ` [Bug c++/11988] " gdr at integrable-solutions dot net
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: derrick at cco dot caltech dot edu @ 2003-08-20  5: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=11988

           Summary: Using "using" in two-stage name lookup
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: derrick at cco dot caltech dot edu
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-linux-gnu

If I am understanding correctly, according to
http://gcc.gnu.org/onlinedocs/gcc/Name-lookup.html#Name%20lookup
the following code should compile:
template <typename T> struct Base {
  int i;
};

template <typename T> struct Derived : public Base<T> {
  int get_i() { using Base<T>::i; return i; }
};

since, according to that document,
"Alternatively, Base<T>::i might be brought into scope by a using-declaration."

However, gcc-3.4-20030813 is rejecting the code with the following errors:
test2.cc: In member function `int Derived<T>::get_i()':
test2.cc:6: error: `Base<T>' is not a namespace
test2.cc:6: error: `i' undeclared (first use this function)
test2.cc:6: error: (Each undeclared identifier is reported only once for each
   function it appears in.)

Is the documentation wrong (or unclear), or the compiler?


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

* [Bug c++/11988] Using "using" in two-stage name lookup
  2003-08-20  5:28 [Bug c++/11988] New: Using "using" in two-stage name lookup derrick at cco dot caltech dot edu
@ 2003-08-20  6:21 ` gdr at integrable-solutions dot net
  2003-08-20 11:06 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: gdr at integrable-solutions dot net @ 2003-08-20  6:21 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=11988



------- Additional Comments From gdr at integrable-solutions dot net  2003-08-20 06:21 -------
Subject: Re:  New: Using "using" in two-stage name lookup

"derrick at cco dot caltech dot edu" <gcc-bugzilla@gcc.gnu.org> writes:

| template <typename T> struct Derived : public Base<T> {
|   int get_i() { using Base<T>::i; return i; }
| };
| 
| since, according to that document,
| "Alternatively, Base<T>::i might be brought into scope by a using-declaration."
| 
| However, gcc-3.4-20030813 is rejecting the code with the following errors:
| test2.cc: In member function `int Derived<T>::get_i()':
| test2.cc:6: error: `Base<T>' is not a namespace
| test2.cc:6: error: `i' undeclared (first use this function)
| test2.cc:6: error: (Each undeclared identifier is reported only once for each
|    function it appears in.)
| 
| Is the documentation wrong (or unclear), or the compiler?

The compiler is broken.

-- Gaby


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

* [Bug c++/11988] Using "using" in two-stage name lookup
  2003-08-20  5:28 [Bug c++/11988] New: Using "using" in two-stage name lookup derrick at cco dot caltech dot edu
  2003-08-20  6:21 ` [Bug c++/11988] " gdr at integrable-solutions dot net
@ 2003-08-20 11:06 ` pinskia at gcc dot gnu dot org
  2003-08-20 15:46 ` nathan at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-20 11:06 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=11988


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-20 11:06:17
               date|                            |


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-20 11:06 -------
I can confirm this on the mainline (20030820).


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

* [Bug c++/11988] Using "using" in two-stage name lookup
  2003-08-20  5:28 [Bug c++/11988] New: Using "using" in two-stage name lookup derrick at cco dot caltech dot edu
  2003-08-20  6:21 ` [Bug c++/11988] " gdr at integrable-solutions dot net
  2003-08-20 11:06 ` pinskia at gcc dot gnu dot org
@ 2003-08-20 15:46 ` nathan at gcc dot gnu dot org
  2003-08-21  3:30 ` derrick at caltech dot edu
  2003-08-21 13:56 ` bangerth at dealii dot org
  4 siblings, 0 replies; 6+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-08-20 15: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=11988


nathan at gcc dot gnu dot org changed:

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


------- Additional Comments From nathan at gcc dot gnu dot org  2003-08-20 15:46 -------
the compiler is correct. A using declaration for a class member shall be a
member-declaration. [7.3.3]/6


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

* [Bug c++/11988] Using "using" in two-stage name lookup
  2003-08-20  5:28 [Bug c++/11988] New: Using "using" in two-stage name lookup derrick at cco dot caltech dot edu
                   ` (2 preceding siblings ...)
  2003-08-20 15:46 ` nathan at gcc dot gnu dot org
@ 2003-08-21  3:30 ` derrick at caltech dot edu
  2003-08-21 13:56 ` bangerth at dealii dot org
  4 siblings, 0 replies; 6+ messages in thread
From: derrick at caltech dot edu @ 2003-08-21  3:30 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=11988



------- Additional Comments From derrick at caltech dot edu  2003-08-21 03:30 -------
Subject: Re:  Using "using" in two-stage name lookup

Ummmm... why was this marked resolved? If the compiler is right, then 
there is still a problem in the documentation, which, as far as I can 
tell, has not been fixed.


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

* [Bug c++/11988] Using "using" in two-stage name lookup
  2003-08-20  5:28 [Bug c++/11988] New: Using "using" in two-stage name lookup derrick at cco dot caltech dot edu
                   ` (3 preceding siblings ...)
  2003-08-21  3:30 ` derrick at caltech dot edu
@ 2003-08-21 13:56 ` bangerth at dealii dot org
  4 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2003-08-21 13:56 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=11988



------- Additional Comments From bangerth at dealii dot org  2003-08-21 13:55 -------
In the documentation, the intent was to have the using declaration in class scope, not 
within the member, to make the name visible to _all_ members. 
 
W.


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

end of thread, other threads:[~2003-08-21 13:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-20  5:28 [Bug c++/11988] New: Using "using" in two-stage name lookup derrick at cco dot caltech dot edu
2003-08-20  6:21 ` [Bug c++/11988] " gdr at integrable-solutions dot net
2003-08-20 11:06 ` pinskia at gcc dot gnu dot org
2003-08-20 15:46 ` nathan at gcc dot gnu dot org
2003-08-21  3:30 ` derrick at caltech dot edu
2003-08-21 13:56 ` bangerth at dealii 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).