re PR c++/3381 (explicit template instantations fail with absolutely qualified names)

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
This commit is contained in:
Nathan Sidwell 2001-12-03 12:39:49 +00:00 committed by Nathan Sidwell
parent a2ad3e94f5
commit f1880e134c
6 changed files with 37 additions and 2 deletions

View 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

View 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

View 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:

View 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.

View File

@ -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

View 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>;