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

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).