Commit 5a96dac6 by Jason Merrill Committed by Jason Merrill

re PR c++/60605 (incorrect diagosis of default template argument for function…

re PR c++/60605 (incorrect diagosis of default template argument for function declaration inside class template member function)

	PR c++/60605
	* pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.

From-SVN: r211754
parent b5116268
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
......
......@@ -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. */
......
// PR c++/60605
template <typename T = int>
struct Foo {
void bar() {
void bug();
}
};
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