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...
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
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:
Known to work: 3.4.0
Known to fail: 4.0.0
Last reconfirmed: 2005-01-01 10:08:24


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
#include "..." search starts here:
#include <...> search starts here:
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).

Comment 2 Andrew Pinski 2004-10-06 03:54:28 UTC
I almost think it was caused by: <> 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:
Comment 6 CVS Commits 2005-01-06 16:04:12 UTC
Subject: Bug 17154

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	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.


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