aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/method.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r--gcc/cp/method.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 386a818..b741516 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1588,6 +1588,12 @@ defaultable_fn_check (tree fn)
{
special_function_kind kind = sfk_none;
+ if (template_parm_scope_p ())
+ {
+ error ("a template cannot be defaulted");
+ return false;
+ }
+
if (DECL_CONSTRUCTOR_P (fn))
{
if (FUNCTION_FIRST_USER_PARMTYPE (fn) == void_list_node)