summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-17 23:09:20 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-17 23:09:20 +0000
commit12e2bae58bbbdf780ac9fa2f8c819f84896f9897 (patch)
tree17ddfa51adbd4d5297c171ec8dbec42f6379bd84 /gcc/cp
parent5f4a118e04ae9dd2c29a53bdcdfa0ca8abf5b495 (diff)
downloadgcc-12e2bae58bbbdf780ac9fa2f8c819f84896f9897.tar.gz
PR c++/60605
* pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211754 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5a8c01dad66..9705f641893 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/60605
+ * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
+
2014-06-15 Jason Merrill <jason@redhat.com>
PR c++/61488
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index df57293d03d..d5cc2576f9d 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -4418,7 +4418,8 @@ check_default_tmpl_args (tree decl, tree parms, bool is_primary,
in the template-parameter-list of the definition of a member of a
class template. */
- if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL)
+ if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL
+ || (TREE_CODE (decl) == FUNCTION_DECL && DECL_LOCAL_FUNCTION_P (decl)))
/* You can't have a function template declaration in a local
scope, nor you can you define a member of a class template in a
local scope. */