aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-05-23 11:32:19 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-05-23 11:32:19 -0400
commit6474197358539b140410d020b0898b4bd30c2252 (patch)
treec69a49cc746301c148a6e7f9d2ca1f28d061f58b /gcc/cp
parent08dc4c3dd7dd26d711a100abb6b0fe78dc712f99 (diff)
downloadgcc-6474197358539b140410d020b0898b4bd30c2252.zip
gcc-6474197358539b140410d020b0898b4bd30c2252.tar.gz
gcc-6474197358539b140410d020b0898b4bd30c2252.tar.bz2
re PR c++/47544 ([C++0x] linker does not find =default constructor for explicitly instantiated template)
PR c++/47544 * pt.c (instantiate_decl): Handle =default. From-SVN: r174071
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/pt.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a1b0aec..f4f04f2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2011-05-23 Jason Merrill <jason@redhat.com>
+ PR c++/47544
+ * pt.c (instantiate_decl): Handle =default.
+
PR c++/48617
* pt.c (invalid_nontype_parm_type_p): Allow DECLTYPE_TYPE.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 380b21e..4299733 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -17432,7 +17432,8 @@ instantiate_decl (tree d, int defer_ok,
args = gen_args;
if (TREE_CODE (d) == FUNCTION_DECL)
- pattern_defined = (DECL_SAVED_TREE (code_pattern) != NULL_TREE);
+ pattern_defined = (DECL_SAVED_TREE (code_pattern) != NULL_TREE
+ || DECL_DEFAULTED_OUTSIDE_CLASS_P (code_pattern));
else
pattern_defined = ! DECL_IN_AGGR_P (code_pattern);
@@ -17627,6 +17628,8 @@ instantiate_decl (tree d, int defer_ok,
cp_finish_decl (d, init, const_init, NULL_TREE, 0);
pop_nested_class ();
}
+ else if (TREE_CODE (d) == FUNCTION_DECL && DECL_DEFAULTED_FN (code_pattern))
+ synthesize_method (d);
else if (TREE_CODE (d) == FUNCTION_DECL)
{
htab_t saved_local_specializations;