diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2003-09-06 18:37:57 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2003-09-06 18:37:57 +0000 |
commit | 1f845b302a1699cd72d8e7b4a9eb47a5566c6407 (patch) | |
tree | 487f31809f60bfa0aec17b50894739717ee2b336 | |
parent | 082124f5c101ed67e20640ec82293f512668455b (diff) | |
download | gcc-1f845b302a1699cd72d8e7b4a9eb47a5566c6407.zip gcc-1f845b302a1699cd72d8e7b4a9eb47a5566c6407.tar.gz gcc-1f845b302a1699cd72d8e7b4a9eb47a5566c6407.tar.bz2 |
re PR c++/11794 (using declaration inside nested class seems ignored)
cp:
PR c++/11794
* class.c (pushclass): Push dependent using decls for nested
classes of templates too.
testsuite:
PR c++/11794
* g++.dg/parse/using3.C: New test.
From-SVN: r71143
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/class.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/parse/using3.C | 22 |
4 files changed, 35 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 944bfd7..0e657be 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-09-06 Nathan Sidwell <nathan@codesourcery.com> + + PR c++/11794 + * class.c (pushclass): Push dependent using decls for nested + classes of templates too. + 2003-09-06 Roger Sayle <roger@eyesopen.com> PR c++/11409 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 80765c0..d17ff5a 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -5466,9 +5466,9 @@ pushclass (tree type) if (type != previous_class_type || current_class_depth > 1) { push_class_decls (type); - if (CLASSTYPE_IS_TEMPLATE (type)) + if (CLASSTYPE_TEMPLATE_INFO (type) && !CLASSTYPE_USE_TEMPLATE (type)) { - /* If we are entering the scope of a template (not a + /* If we are entering the scope of a template declaration (not a specialization), we need to push all the using decls with dependent scope too. */ tree fields; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e3c766c..331c00d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-09-06 Nathan Sidwell <nathan@codesourcery.com> + + PR c++/11794 + * g++.dg/parse/using3.C: New test. + 2003-09-06 Roger Sayle <roger@eyesopen.com> PR c++/11409 diff --git a/gcc/testsuite/g++.dg/parse/using3.C b/gcc/testsuite/g++.dg/parse/using3.C new file mode 100644 index 0000000..c266b68 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/using3.C @@ -0,0 +1,22 @@ +// { dg-do compile } + +// Copyright (C) 2003 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 6 Sep 2003 <nathan@codesourcery.com> +// Origin: stefaandr@hotmail.com + +// PR c++/11794. Using decl in nested classes of a template class + +template <typename T> struct a +{ + struct a1: T + { + using T::aa; + + a1() { aa = 5; } + }; +}; +struct b { int aa; }; +template <> struct a<int>::a1 { a1 () {} }; + +a<b>::a1 a_b; +a<int>::a1 a_i; |