decl.c (store_parm_decls): Don't build cleanups for parameters while processing_template_decl.

* decl.c (store_parm_decls): Don't build cleanups for parameters
	while processing_template_decl.

From-SVN: r31842
This commit is contained in:
Mark Mitchell 2000-02-07 23:41:01 +00:00 committed by Mark Mitchell
parent de9127c1b7
commit ff47d09463
3 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2000-02-07 Mark Mitchell <mark@codesourcery.com>
* decl.c (store_parm_decls): Don't build cleanups for parameters
while processing_template_decl.
2000-02-07 Jason Merrill <jason@casey.cygnus.com>
* cp-tree.h (struct saved_scope): Add incomplete field.

View File

@ -13409,7 +13409,9 @@ store_parm_decls ()
else
cp_error ("parameter `%D' declared void", parm);
cleanup = maybe_build_cleanup (parm);
cleanup = (processing_template_decl
? NULL_TREE
: maybe_build_cleanup (parm));
if (cleanup)
cleanups = tree_cons (parm, cleanup, cleanups);

View File

@ -0,0 +1,24 @@
// Build don't link:
// Origin: Mark Mitchell <mark@codesourcery.com>
int i;
struct S
{
~S ()
{
}
};
template <class T>
void f (T, S)
{
i = 0;
}
int main ()
{
i = 1;
f (3, S ());
return i;
}