diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2012-07-31 09:46:46 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-07-31 09:46:46 +0000 |
commit | 8dca7e9303de95cd422deb8703a7554740550c8a (patch) | |
tree | b8132fd181a49cc5240f1c4584b6bbbdcec337a7 /gcc/cp | |
parent | 3ad45f7ff3ef4e3c863ea668e8ddb13f7185c8ad (diff) | |
download | gcc-8dca7e9303de95cd422deb8703a7554740550c8a.zip gcc-8dca7e9303de95cd422deb8703a7554740550c8a.tar.gz gcc-8dca7e9303de95cd422deb8703a7554740550c8a.tar.bz2 |
re PR c++/53624 (GCC rejects function local types in template function with default template arguments)
/cp
2012-07-31 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53624
* pt.c (check_default_tmpl_args): Don't check local types.
/testsuite
2012-07-31 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53624
* g++.dg/cpp0x/temp_default5.C: New.
From-SVN: r190001
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2d87bdc..8604169 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,8 +1,12 @@ +2012-07-31 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/53624 + * pt.c (check_default_tmpl_args): Don't check local types. + 2012-07-25 Sandra Loosemore <sandra@codesourcery.com> Paul Brook <paul@codesourcery.com> PR target/53633 - * decl.c (finish_function): Check targetm.warn_func_return. 2012-07-25 Jason Merrill <jason@redhat.com> diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 07b294f..31ae3ef 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4267,7 +4267,8 @@ check_default_tmpl_args (tree decl, tree parms, int is_primary, /* Core issue 226 (C++0x only): the following only applies to class templates. */ - if ((cxx_dialect == cxx98) || TREE_CODE (decl) != FUNCTION_DECL) + if (is_primary + && ((cxx_dialect == cxx98) || TREE_CODE (decl) != FUNCTION_DECL)) { /* [temp.param] @@ -4299,8 +4300,7 @@ check_default_tmpl_args (tree decl, tree parms, int is_primary, TREE_PURPOSE (parm) = error_mark_node; no_errors = false; } - else if (is_primary - && !is_partial + else if (!is_partial && !is_friend_decl /* Don't complain about an enclosing partial specialization. */ |