This compiles with 3.4.1, but not with current cvs: template <int numrows, class T> struct A { void test_A() {}; }; template <int numrows, class T> struct B {}; template <class T> struct B <3, T> : public A <3, T> { using A <3, T>::test_A; void test_B_spec() { test_A(); }; }; Reading specs from /esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5.0/specs Configured with: /esat/alexandria1/stefaan/src/gcc/main/configure --prefix=/esat/olympia/install --program-suffix=-3.5 --enable-languages=c,c++ Thread model: posix gcc version 3.5.0 20040822 (experimental) /esat/olympia/install/libexec/gcc/i686-pc-linux-gnu/3.5.0/cc1plus -quiet -v -D_GNU_SOURCE matrixtest.cpp -quiet -dumpbase matrixtest.cpp -mtune=pentiumpro -auxbase-strip matrixtest.o -version -o /tmp/ccD3ifGt.s ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../include/c++/3.5.0 /esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../include/c++/3.5.0/i686-pc-linux-gnu /esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../include/c++/3.5.0/backward /esat/olympia/install/include /esat/olympia/install/lib/gcc/i686-pc-linux-gnu/3.5.0/include /usr/include End of search list. GNU C++ version 3.5.0 20040822 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 3.4.1. GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 matrixtest.cpp: In member function `void B<3, T>::test_B_spec()': matrixtest.cpp:5: error: there are no arguments to `test_A' that depend on a template parameter, so a declaration of `test_A' must be available matrixtest.cpp:5: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
: Search converges between 2004-07-14-trunk (#486) and 2004-07-16-trunk (#487). Confirmed.
I almost think it was caused by: <http://gcc.gnu.org/ml/gcc-patches/2004-07/msg01444.html> but I could be wrong.
We don't support proper semantic in using declarations yet, but regressing on that seems a bug anyway.
Got it.
Patch submitted: http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00036.html
Subject: Bug 17154 CVSROOT: /cvs/gcc Module name: gcc Changes by: lerdsuwa@gcc.gnu.org 2005-01-06 16:04:06 Modified files: gcc/cp : ChangeLog search.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: using9.C Log message: PR c++/17154 * search.c (lookup_field_1): Handle using declaration in class template partial specialization. * g++.dg/template/using9.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4570&r2=1.4571 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/search.c.diff?cvsroot=gcc&r1=1.342&r2=1.343 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4855&r2=1.4856 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/using9.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Fixed in the mainline.