Commit f8191e64 by Mark Mitchell Committed by Mark Mitchell

pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch paramter.

	* pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch
	paramter.

	* semantics.c (expand_stmt): Don't pretend to have asmspecs for
	local statics if we don't really have them.

	* ir.texi: Improve documentation for STMT_EXPR.  Describe
	CLEANUP_POINT_EXPR.

From-SVN: r29863
parent 7d005869
1999-10-07 Mark Mitchell <mark@codesourcery.com>
* pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch
paramter.
* semantics.c (expand_stmt): Don't pretend to have asmspecs for
local statics if we don't really have them.
* ir.texi: Improve documentation for STMT_EXPR. Describe
CLEANUP_POINT_EXPR.
1999-10-07 Jason Merrill <jason@yorick.cygnus.com> 1999-10-07 Jason Merrill <jason@yorick.cygnus.com>
* class.c (build_vtable_entry_ref): Use finish_asm_stmt. * class.c (build_vtable_entry_ref): Use finish_asm_stmt.
......
...@@ -1475,6 +1475,7 @@ The @code{WHILE_BODY} is the body of the loop. ...@@ -1475,6 +1475,7 @@ The @code{WHILE_BODY} is the body of the loop.
@tindex BIND_EXPR @tindex BIND_EXPR
@tindex LOOP_EXPR @tindex LOOP_EXPR
@tindex EXIT_EXPR @tindex EXIT_EXPR
@tindex CLEANUP_POINT_EXPR
@tindex ARRAY_REF @tindex ARRAY_REF
The internal representation for expressions is for the most part quite The internal representation for expressions is for the most part quite
...@@ -1824,7 +1825,19 @@ expression would normally appear. The @code{STMT_EXPR} node represents ...@@ -1824,7 +1825,19 @@ expression would normally appear. The @code{STMT_EXPR} node represents
such an expression. The @code{STMT_EXPR_STMT} gives the statement such an expression. The @code{STMT_EXPR_STMT} gives the statement
contained in the expression; this is always a @code{COMPOUND_STMT}. The contained in the expression; this is always a @code{COMPOUND_STMT}. The
value of the expression is the value of the last sub-statement in the value of the expression is the value of the last sub-statement in the
@code{COMPOUND_STMT}. @code{COMPOUND_STMT}. More precisely, the value is the value computed
by the last @code{EXPR_STMT} in the outermost scope of the
@code{COMPOUND_STMT}. For example, in:
@example
(@{ 3; @})
@end example
the value is @code{3} while in:
@example
(@{ if (x) { 3; } @})
@end example
(represented by a nested @code{COMPOUND_STMT}), there is no value. If
the @code{STMT_EXPR} does not yield a value, it's type will be
@code{void}.
@item BIND_EXPR @item BIND_EXPR
These nodes represent local blocks. The first operand is a list of These nodes represent local blocks. The first operand is a list of
...@@ -1844,6 +1857,12 @@ These nodes represent conditional exits from the nearest enclosing ...@@ -1844,6 +1857,12 @@ These nodes represent conditional exits from the nearest enclosing
non-zero, then the loop should be exited. An @code{EXIT_EXPR} will only non-zero, then the loop should be exited. An @code{EXIT_EXPR} will only
appear within a @code{LOOP_EXPR}. appear within a @code{LOOP_EXPR}.
@item CLEANUP_POINT_EXPR
These nodes represent full-expressions. The single oeprand is an
expression to evaluate. Any destructor calls engendered by the creation
of temporaries during the evaluation of that expression should be
performed immediately after the expression is evaluated.
@item CONSTRUCTOR @item CONSTRUCTOR
These nodes represent the brace-enclosed initializers for a structure or These nodes represent the brace-enclosed initializers for a structure or
array. The first operand is reserved for use by the back-end. The array. The first operand is reserved for use by the back-end. The
......
...@@ -7424,6 +7424,10 @@ tsubst_expr (t, args, complain, in_decl) ...@@ -7424,6 +7424,10 @@ tsubst_expr (t, args, complain, in_decl)
{ {
decl = DECL_STMT_DECL (HANDLER_PARMS (t)); decl = DECL_STMT_DECL (HANDLER_PARMS (t));
decl = tsubst (decl, args, complain, in_decl); decl = tsubst (decl, args, complain, in_decl);
/* Prevent instantiate_decl from trying to instantiate
this variable. We've already done all that needs to be
done. */
DECL_TEMPLATE_INSTANTIATED (decl) = 1;
} }
else else
decl = NULL_TREE; decl = NULL_TREE;
......
...@@ -2301,9 +2301,21 @@ expand_stmt (t) ...@@ -2301,9 +2301,21 @@ expand_stmt (t)
DECL_ANON_UNION_ELEMS (decl)); DECL_ANON_UNION_ELEMS (decl));
} }
else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)) else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
rest_of_decl_compilation {
(decl, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), const char *asmspec = NULL;
/*top_level=*/0, /*at_end=*/0);
if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
{
/* The only way this situaton can occur is if the
user specified a name for this DECL using the
`attribute' syntax. */
asmspec = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
DECL_ASSEMBLER_NAME (decl) = DECL_NAME (decl);
}
rest_of_decl_compilation (decl, asmspec,
/*top_level=*/0, /*at_end=*/0);
}
resume_momentary (i); resume_momentary (i);
} }
......
// Build don't link:
// Origin: Mark Mitchell <mark@codesourcery.com>
struct S
{
int i;
};
template <class T>
void f ()
{
try {
} catch (S& s) {
s.i = 3;
}
}
template void f<int>();
// Build don't link:
// Origin: Ulrich Drepper <drepper@cygnus.com>
struct st
{
int a, b, c, d;
};
void g ()
{
static const st i = { 0,1,2,3 };
}
void h ()
{
static const st i = { 0,1,2,3 };
}
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