Commit 312a0c90 by Mark Mitchell Committed by Mark Mitchell

decl.c (pushtag): Avoid crashing on erroneous input.

1998-05-25  Mark Mitchell  <mark@markmitchell.com>
	* decl.c (pushtag): Avoid crashing on erroneous input.

From-SVN: r20056
parent 954b0af8
1998-05-26 Mark Mitchell <mark@markmitchell.com>
* decl.c (pushtag): Avoid crashing on erroneous input.
1998-05-25 Martin v. Lwis <loewis@informatik.hu-berlin.de>
* decl.c (push_namespace): Only produce one unique name for
......
......@@ -2236,7 +2236,16 @@ pushtag (name, type, globalize)
TYPE_NAME (type) = d;
DECL_CONTEXT (d) = context;
if (IS_AGGR_TYPE (type)
if (processing_template_parmlist)
/* You can't declare a new template type in a template
parameter list. But, you can declare a non-template
type:
template <class A*> struct S;
is a forward-declaration of `A'. */
;
else if (IS_AGGR_TYPE (type)
&& (/* If !GLOBALIZE then we are looking at a
definition. It may not be a primary template.
(For example, in:
......@@ -2255,15 +2264,9 @@ pushtag (name, type, globalize)
friend class S2;
};
declares S2 to be at global scope. We must be
careful, however, of the following case:
template <class A*> struct S;
which declares a non-template class `A'. */
|| (!processing_template_parmlist
&& (processing_template_decl >
template_class_depth (current_class_type)))))
declares S2 to be at global scope. */
|| (processing_template_decl >
template_class_depth (current_class_type))))
{
d = push_template_decl_real (d, globalize);
/* If the current binding level is the binding level for
......
// Build don't link:
class foo
{
};
template <class T : public foo> // ERROR - base clause
struct bar
{
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment