Commit 05424ee6 by Paolo Carlini Committed by Paolo Carlini

re PR c++/62219 ([c++11] Spurious error for lambda in a friend function of a…

re PR c++/62219 ([c++11] Spurious error for lambda in a friend function of a class template with a default template parameters)

/cp
2014-09-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/62219
	* pt.c (check_default_tmpl_args): Check LAMBDA_FUNCTION_P.

/testsuite
2014-09-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/62219
	* g++.dg/cpp0x/lambda/lambda-template14.C: New.

From-SVN: r215477
parent 69e69c01
2014-09-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/62219
* pt.c (check_default_tmpl_args): Check LAMBDA_FUNCTION_P.
2014-09-22 Jason Merrill <jason@redhat.com> 2014-09-22 Jason Merrill <jason@redhat.com>
* decl.c (poplevel): Don't warn about unused vars in template scope. * decl.c (poplevel): Don't warn about unused vars in template scope.
......
...@@ -4456,9 +4456,11 @@ check_default_tmpl_args (tree decl, tree parms, bool is_primary, ...@@ -4456,9 +4456,11 @@ check_default_tmpl_args (tree decl, tree parms, bool is_primary,
local scope. */ local scope. */
return true; return true;
if (TREE_CODE (decl) == TYPE_DECL if ((TREE_CODE (decl) == TYPE_DECL
&& TREE_TYPE (decl) && TREE_TYPE (decl)
&& LAMBDA_TYPE_P (TREE_TYPE (decl))) && LAMBDA_TYPE_P (TREE_TYPE (decl)))
|| (TREE_CODE (decl) == FUNCTION_DECL
&& LAMBDA_FUNCTION_P (decl)))
/* A lambda doesn't have an explicit declaration; don't complain /* A lambda doesn't have an explicit declaration; don't complain
about the parms of the enclosing class. */ about the parms of the enclosing class. */
return true; return true;
......
2014-09-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/62219
* g++.dg/cpp0x/lambda/lambda-template14.C: New.
2014-09-22 Alan Lawrence <alan.lawrence@arm.com> 2014-09-22 Alan Lawrence <alan.lawrence@arm.com>
* gcc.dg/vect/vect-reduc-or_1.c: New test. * gcc.dg/vect/vect-reduc-or_1.c: New test.
......
// PR c++/62219
// { dg-do compile { target c++11 } }
template< class = void >
struct S
{
friend void foo( S )
{
[](){};
}
};
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