Commit 8dca7e93 by Paolo Carlini Committed by Paolo Carlini

re PR c++/53624 (GCC rejects function local types in template function with…

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
parent 3ad45f7f
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> 2012-07-25 Sandra Loosemore <sandra@codesourcery.com>
Paul Brook <paul@codesourcery.com> Paul Brook <paul@codesourcery.com>
PR target/53633 PR target/53633
* decl.c (finish_function): Check targetm.warn_func_return. * decl.c (finish_function): Check targetm.warn_func_return.
2012-07-25 Jason Merrill <jason@redhat.com> 2012-07-25 Jason Merrill <jason@redhat.com>
......
...@@ -4267,7 +4267,8 @@ check_default_tmpl_args (tree decl, tree parms, int is_primary, ...@@ -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 /* Core issue 226 (C++0x only): the following only applies to class
templates. */ templates. */
if ((cxx_dialect == cxx98) || TREE_CODE (decl) != FUNCTION_DECL) if (is_primary
&& ((cxx_dialect == cxx98) || TREE_CODE (decl) != FUNCTION_DECL))
{ {
/* [temp.param] /* [temp.param]
...@@ -4299,8 +4300,7 @@ check_default_tmpl_args (tree decl, tree parms, int is_primary, ...@@ -4299,8 +4300,7 @@ check_default_tmpl_args (tree decl, tree parms, int is_primary,
TREE_PURPOSE (parm) = error_mark_node; TREE_PURPOSE (parm) = error_mark_node;
no_errors = false; no_errors = false;
} }
else if (is_primary else if (!is_partial
&& !is_partial
&& !is_friend_decl && !is_friend_decl
/* Don't complain about an enclosing partial /* Don't complain about an enclosing partial
specialization. */ specialization. */
......
2012-07-31 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53624
* g++.dg/cpp0x/temp_default5.C: New.
2012-07-30 Janus Weil <janus@gcc.gnu.org> 2012-07-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/51081 PR fortran/51081
......
// { dg-options "-std=c++11" }
template <class Z = void, class T>
void Foo(T)
{
struct X {};
}
template <class T = int, typename U>
void f(const U&)
{
auto g = [] () {};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment