User account creation filtered due to spam.

Bug 17154 - [4.0 Regression] Using declaration of function name ignored inside partial specialization of template class
Summary: [4.0 Regression] Using declaration of function name ignored inside partial sp...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.0
: P2 critical
Target Milestone: 4.0.0
Assignee: Kriang Lerdsuwanakij
URL:
Keywords: monitored, patch, rejects-valid
Depends on: 18805
Blocks: 12944
  Show dependency treegraph
 
Reported: 2004-08-23 14:50 UTC by Stefaan De Roeck
Modified: 2005-01-06 16:06 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.4.0
Known to fail: 4.0.0
Last reconfirmed: 2005-01-01 10:08:24


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefaan De Roeck 2004-08-23 14:50:24 UTC
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)
Comment 1 Andrew Pinski 2004-08-23 15:03:59 UTC
: Search converges between 2004-07-14-trunk (#486) and 2004-07-16-trunk (#487).

Confirmed.
Comment 2 Andrew Pinski 2004-10-06 03:54:28 UTC
I almost think it was caused by: <http://gcc.gnu.org/ml/gcc-patches/2004-07/msg01444.html> but I 
could be wrong.
Comment 3 Giovanni Bajo 2004-10-06 10:34:44 UTC
We don't support proper semantic in using declarations yet, but regressing on 
that seems a bug anyway.
Comment 4 Kriang Lerdsuwanakij 2005-01-01 10:08:24 UTC
Got it.
Comment 5 Kriang Lerdsuwanakij 2005-01-02 11:27:21 UTC
Patch submitted:
  http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00036.html
Comment 6 CVS Commits 2005-01-06 16:04:12 UTC
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

Comment 7 Kriang Lerdsuwanakij 2005-01-06 16:06:21 UTC
Fixed in the mainline.