OSDN Git Service

cp:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Dec 2001 12:39:49 +0000 (12:39 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Dec 2001 12:39:49 +0000 (12:39 +0000)
PR g++/3381
* parse.y (named_complex_class_head_sans_basetype): Add new
reduction.
* Make-lang.in (parse.c): Adjust expected conflict count.
testsuite:
* g++.dg/other/scope1.C: New test.
* g++.dg/template/explicit-instantiation.C: Remove XFAIL

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47546 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/Make-lang.in
gcc/cp/parse.y
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/scope1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/explicit-instantiation.C

index eaa3a9b..6b97075 100644 (file)
@@ -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
index 2a4d6af..eb42dec 100644 (file)
@@ -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
index 449ea98..a27f288 100644 (file)
@@ -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:
index 7f71389..a9715d8 100644 (file)
@@ -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 (file)
index 0000000..73b141b
--- /dev/null
@@ -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
index 9afc35f..67e44c4 100644 (file)
@@ -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>;