From 15e0646fde23f549c224be5ba3ee9bd11eb748de Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 18 Oct 2011 15:36:28 -0400 Subject: re PR c++/50531 ([C++0x] ICE on defaulted template destructor) PR c++/50531 * pt.c (instantiate_decl): Recognize when a function defaulted outside the class is already instantiated. From-SVN: r180162 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/pt.c | 2 ++ 2 files changed, 6 insertions(+) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 24ca654..402f5b5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2011-10-18 Jason Merrill + PR c++/50531 + * pt.c (instantiate_decl): Recognize when a function defaulted + outside the class is already instantiated. + PR c++/50742 * decl.c (check_previous_goto_1): Handle using-decl. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 6fc60d5..56fa632 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -18045,6 +18045,8 @@ instantiate_decl (tree d, int defer_ok, d = DECL_CLONED_FUNCTION (d); if (DECL_TEMPLATE_INSTANTIATED (d) + || (TREE_CODE (d) == FUNCTION_DECL + && DECL_DEFAULTED_FN (d) && DECL_INITIAL (d)) || DECL_TEMPLATE_SPECIALIZATION (d)) /* D has already been instantiated or explicitly specialized, so there's nothing for us to do here. -- cgit v1.1