aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/Make-lang.in2
-rw-r--r--gcc/cp/parse.y7
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/other/scope1.C14
-rw-r--r--gcc/testsuite/g++.dg/template/explicit-instantiation.C4
6 files changed, 37 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index eaa3a9b..6b97075 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2001-12-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR g++/3381
+ * parse.y (named_complex_class_head_sans_basetype): Add new
+ reduction.
+ * Make-lang.in (parse.c): Adjust expected conflict count.
+
2001-12-03 Jason Merrill <jason@redhat.com>
* class.c (finish_vtbls): Fill in BINFO_VPTR_FIELD in the
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 2a4d6af..eb42dec 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -119,7 +119,7 @@ $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf
$(srcdir)/cp/cfns.gperf > $(srcdir)/cp/cfns.h
$(srcdir)/cp/parse.h $(srcdir)/cp/parse.c: $(srcdir)/cp/parse.y
- @echo "Expect 33 shift/reduce conflicts and 58 reduce/reduce conflicts."
+ @echo "Expect 36 shift/reduce conflicts and 58 reduce/reduce conflicts."
cd $(srcdir)/cp; $(BISON) $(BISONFLAGS) -d -o p$$$$.c parse.y ; \
grep '^#define[ ]*YYEMPTY' p$$$$.c >> p$$$$.h ; \
mv -f p$$$$.c parse.c ; mv -f p$$$$.h parse.h
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index 449ea98..a27f288 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -2404,6 +2404,13 @@ named_complex_class_head_sans_basetype:
push_scope (CP_DECL_CONTEXT ($$.t));
$$.new_type_flag = 1;
}
+ | aggr global_scope nested_name_specifier apparent_template_type
+ {
+ current_aggr = $1;
+ $$.t = $4;
+ push_scope (CP_DECL_CONTEXT ($$.t));
+ $$.new_type_flag = 1;
+ }
;
named_class_head:
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7f71389..a9715d8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2001-12-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.dg/other/scope1.C: New test.
+ * g++.dg/template/explicit-instantiation.C: Remove XFAIL
+
2001-12-03 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.dg/vla-init-1.c: New test.
diff --git a/gcc/testsuite/g++.dg/other/scope1.C b/gcc/testsuite/g++.dg/other/scope1.C
new file mode 100644
index 0000000..73b141b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/scope1.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Nov 2001 <nathan@nathan@codesourcery.com>
+
+// PR 3381
+
+namespace N {
+ template<class T>
+ class A { };
+}
+
+template class N::A<unsigned>; // this works (by itself)
+template class ::N::A<int>; // but this doesn't
diff --git a/gcc/testsuite/g++.dg/template/explicit-instantiation.C b/gcc/testsuite/g++.dg/template/explicit-instantiation.C
index 9afc35f..67e44c4 100644
--- a/gcc/testsuite/g++.dg/template/explicit-instantiation.C
+++ b/gcc/testsuite/g++.dg/template/explicit-instantiation.C
@@ -2,13 +2,15 @@
// Origin: Jens.Maurer@gmx.net
// { dg-do compile }
+// Fixed: PR 3381
+
namespace N
{
template<class T>
class A { };
}
-template class ::N::A<int>; // { dg-bogus ".*" "" { xfail *-*-* } }
+template class ::N::A<int>;