This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: namespace buglet
- To: brendan at cygnus dot com
- Subject: Re: namespace buglet
- From: "Martin v. Loewis" <loewis at informatik dot hu-berlin dot de>
- Date: Sat, 30 May 1998 17:05:27 +0200
- CC: jason at cygnus dot com, egcs-patches at cygnus dot com
- References: <5431.896484046@lisa.cygnus.com>
> I ran into this particular bug:
>
> t.C:6: no class template named `iterator' in `std'
> t.C:6: confused by earlier errors, bailing out
>
> Could ya take a peek?
In the current egcs, there is no std::iterator, unless -fhonor-std is
given. My egcs gives a different error, for which I provide a patch
below:
a.ii:7: sorry, not implemented: `namespace_decl' not supported by dump_type
a.ii:7: no class template named `S' in `'
a.ii:7: confused by earlier errors, bailing out
Martin
1998-05-30 Martin von Löwis <loewis@informatik.hu-berlin.de>
* decl.c (make_typename_type): If context is a namespace, the code
is in error.
Index: decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.129
diff -c -p -r1.129 decl.c
*** decl.c 1998/05/29 14:18:51 1.129
--- decl.c 1998/05/30 14:50:03
*************** make_typename_type (context, name)
*** 4602,4607 ****
--- 4625,4639 ----
fullname = name;
+ if (TREE_CODE (context) == NAMESPACE_DECL)
+ {
+ /* At this point, the scanner should have found and reported
+ name as class or template. Since it didn't, there is no such
+ type. */
+ cp_error ("unknown type `%D::%D'", context, name);
+ return error_mark_node;
+ }
+
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
{
name = TREE_OPERAND (name, 0);
--- /dev/null Mon Jul 18 01:46:18 1994
+++ g++.ns/undef1.C Sat May 30 17:01:53 1998
@@ -0,0 +1,5 @@
+//Build don't link:
+namespace A{
+}
+
+struct Y: A::S<int>{}; //ERROR - no such type