]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/3381 (explicit template instantations fail with absolutely qualified names)
authorNathan Sidwell <nathan@codesourcery.com>
Mon, 3 Dec 2001 12:39:49 +0000 (12:39 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Mon, 3 Dec 2001 12:39:49 +0000 (12:39 +0000)
cp:
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

From-SVN: r47546

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 eaa3a9ba4d617d43eaf95c0ce18e3ff60f85c656..6b970756d4a4ea3473a4715062cdf78b121920cf 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 2a4d6af369440cf118a5d0b030788766a0f5a928..eb42decff4fe6139989bbfe801c9047fd1e76b38 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 449ea9830d0ccb9ed6dddcec365bb43f144016b7..a27f288eedcb9fed42887c5a84b4c5d27ea2bd0b 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 7f7138990e13bc9ce3a44da01bfabadd610011d6..a9715d8734e44d47b3556b654ac017b68d12ed44 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 9afc35fccc571ae126a1c05abcbb73616e02c284..67e44c49f024c840034b23eb9698ff07853b61b3 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>;