[Bug c++/11988] New: Using "using" in two-stage name lookup
derrick at cco dot caltech dot edu
gcc-bugzilla@gcc.gnu.org
Wed Aug 20 05:28:00 GMT 2003
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?
More information about the Gcc-bugs
mailing list