aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2001-01-23 10:44:18 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2001-01-23 10:44:18 +0000
commit92ecdfb74c6b4c1e1812afcc9a7aa79217da11ad (patch)
treebaf335a9274273d28c065d4e2be27603c4833ee6 /gcc
parent4cff6abe405f4e4d660ab6f6cf8b29ba9d49d4fd (diff)
downloadgcc-92ecdfb74c6b4c1e1812afcc9a7aa79217da11ad.zip
gcc-92ecdfb74c6b4c1e1812afcc9a7aa79217da11ad.tar.gz
gcc-92ecdfb74c6b4c1e1812afcc9a7aa79217da11ad.tar.bz2
decl.c (grokdeclarator): Don't presume DECL_LANG_SPECIFIC indicates anything special about template depth.
cp: * decl.c (grokdeclarator): Don't presume DECL_LANG_SPECIFIC indicates anything special about template depth. Make sure we only count the user visible template classes. testsuite: * g++.old-deja/g++.pt/spec37.C: New test. From-SVN: r39198
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c8
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/spec37.C25
4 files changed, 38 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f5b46ff..166d0c1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
2001-01-23 Nathan Sidwell <nathan@codesourcery.com>
+ * decl.c (grokdeclarator): Don't presume DECL_LANG_SPECIFIC
+ indicates anything special about template depth. Make sure we
+ only count the user visible template classes.
+
+2001-01-23 Nathan Sidwell <nathan@codesourcery.com>
+
* call.c (build_conv): Typo in comment.
(add_builtin_candidate): Add more explanation.
Remove extra test for ENUMERAL_TYPE in {PRE,POST}INCREMENT_EXPR.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 158407c..6fcf9c4 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10807,14 +10807,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
the definition of `S<int>::f'. */
if (CLASSTYPE_TEMPLATE_INFO (t)
&& (CLASSTYPE_TEMPLATE_INSTANTIATION (t)
- || uses_template_parms (CLASSTYPE_TI_ARGS (t))))
+ || uses_template_parms (CLASSTYPE_TI_ARGS (t)))
+ && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t)))
template_count += 1;
t = TYPE_MAIN_DECL (t);
- if (DECL_LANG_SPECIFIC (t))
- t = DECL_CONTEXT (t);
- else
- t = NULL_TREE;
+ t = DECL_CONTEXT (t);
}
if (sname == NULL_TREE)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 31f25fb..649f327 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2001-01-23 Nathan Sidwell <nathan@codesourcery.com>
+ * g++.old-deja/g++.pt/spec37.C: New test.
+
+2001-01-23 Nathan Sidwell <nathan@codesourcery.com>
+
* g++.old-deja/g++.pt/overload14.C: New test.
2001-01-22 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec37.C b/gcc/testsuite/g++.old-deja/g++.pt/spec37.C
new file mode 100644
index 0000000..5578c30
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec37.C
@@ -0,0 +1,25 @@
+// Build don't link:
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Jan 2001 <nathan@codesourcery.com>
+
+// Bug 1728. We started sorting things when there were 7 fields. Our
+// template_count algorithm was rather fragile ...
+
+template <int dim> struct X
+{
+ struct Y
+ {
+ int x1;
+ int x2;
+ int x3;
+ int x4;
+ int x5;
+ int x6;
+ int x7;
+
+ void Foo ();
+ };
+};
+
+template <> void X<1>::Y::Foo () {}