diff options
author | Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> | 2005-01-06 16:04:05 +0000 |
---|---|---|
committer | Kriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org> | 2005-01-06 16:04:05 +0000 |
commit | 023458fab2520e557d9c4075b568ffcea3467f48 (patch) | |
tree | 1502c1fa1cbff0c72d36506b0b9c95bf80de25cd /gcc | |
parent | 23ff7e2d27290094883a2c4e0414a880209aa7ac (diff) | |
download | gcc-023458fab2520e557d9c4075b568ffcea3467f48.zip gcc-023458fab2520e557d9c4075b568ffcea3467f48.tar.gz gcc-023458fab2520e557d9c4075b568ffcea3467f48.tar.bz2 |
re PR c++/17154 (Using declaration of function name ignored inside partial specialization of template class)
PR c++/17154
* search.c (lookup_field_1): Handle using declaration in
class template partial specialization.
* g++.dg/template/using9.C: New test.
From-SVN: r92994
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/search.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/using9.C | 12 |
4 files changed, 28 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 628d046..600e945 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2005-01-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + PR c++/17154 + * search.c (lookup_field_1): Handle using declaration in + class template partial specialization. + +2005-01-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + PR c++/19258 * pt.c (push_access_scope): Handle friend defined in class. (pop_access_scope): Likewise. diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 8c26565..8d5ae65 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -1,7 +1,7 @@ /* Breadth-first and depth-first routines for searching multiple-inheritance lattice for GNU C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -470,13 +470,10 @@ lookup_field_1 (tree type, tree name, bool want_type) the compiler cannot handle that. Once the class is defined, USING_DECLs are purged from TYPE_FIELDS; see handle_using_decl. However, we make special efforts to - make using-declarations in template classes work - correctly. */ - if (CLASSTYPE_TEMPLATE_INFO (type) - && !CLASSTYPE_USE_TEMPLATE (type) - && !TREE_TYPE (field)) - ; - else + make using-declarations in class templates and class + template partial specializations work correctly noticing + that dependent USING_DECL's do not have TREE_TYPE set. */ + if (TREE_TYPE (field)) continue; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8ed16ad..de33069 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-01-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + + PR c++/17154 + * g++.dg/template/using9.C: New test. + 2005-01-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> PR c++/19258 diff --git a/gcc/testsuite/g++.dg/template/using9.C b/gcc/testsuite/g++.dg/template/using9.C new file mode 100644 index 0000000..a2c06a7 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/using9.C @@ -0,0 +1,12 @@ +// { dg-do compile } + +// Origin: stefaandr@hotmail.com + +// PR c++/17154: Using declaration in partial class template specialization. + +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(); }; +}; |