public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11467] New: using doesn't help with two-stage lookup of members in template base
@ 2003-07-08 14:17 benko at sztaki dot hu
  2003-07-08 14:34 ` [Bug c++/11467] " bangerth at dealii dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: benko at sztaki dot hu @ 2003-07-08 14:17 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=11467

           Summary: using doesn't help with two-stage lookup of members in
                    template base
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: benko at sztaki dot hu
                CC: gcc-bugs at gcc dot gnu dot org

Using the hint in

http://gcc.gnu.org/onlinedocs/gcc/Name-lookup.html

("Alternatively, Base<T>::i might be
brought into scope by a using-declaration.")

I modified the example given there as

arta:~/c/proba$ cat templ_base.cc
template <typename T> struct Base {
  int i;
};

template <typename T> struct Derived : public Base<T> {
  using Base<T>::i;
  
  int get_i() { return i; }
};
arta:~/c/proba$ g++-cvs -v
Reading specs from /gml/shared/gcc-cvs/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: ../gcc/configure --prefix=/gml/shared/gcc-cvs
--enable-languages=c++
Thread model: posix
gcc version 3.4 20030708 (experimental)
arta:~/c/proba$ g++-cvs templ_base.cc
templ_base.cc: In member function `int Derived<T>::get_i()':
templ_base.cc:8: error: `i' has not been declared
zsh: exit 1     g++-cvs templ_base.cc
arta:~/c/proba$ 

(Putting the using into get_i is even worse.)


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

end of thread, other threads:[~2003-07-16 11:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-08 14:17 [Bug c++/11467] New: using doesn't help with two-stage lookup of members in template base benko at sztaki dot hu
2003-07-08 14:34 ` [Bug c++/11467] " bangerth at dealii dot org
2003-07-14 17:12 ` benko at sztaki dot hu
2003-07-16 11:01 ` nathan 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).