re PR c++/55680 ([C++11] Member specialization with lambda is rejected)

PR c++/55680
	* pt.c (maybe_process_partial_specialization): A lambda
	isn't what's being specialized.

From-SVN: r196042
This commit is contained in:
Jason Merrill 2013-02-13 23:30:26 -05:00 committed by Jason Merrill
parent 561f7fc72c
commit e75e98f270
3 changed files with 16 additions and 0 deletions

View File

@ -1,5 +1,9 @@
2013-02-13 Jason Merrill <jason@redhat.com>
PR c++/55680
* pt.c (maybe_process_partial_specialization): A lambda
isn't what's being specialized.
PR c++/55710
* semantics.c (maybe_add_lambda_conv_op): Mark static thunk
TREE_USED.

View File

@ -802,6 +802,11 @@ maybe_process_partial_specialization (tree type)
if (type == error_mark_node)
return error_mark_node;
/* A lambda that appears in specialization context is not itself a
specialization. */
if (CLASS_TYPE_P (type) && CLASSTYPE_LAMBDA_EXPR (type))
return type;
if (TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM)
{
error ("name of class shadows template template parameter %qD",

View File

@ -0,0 +1,7 @@
// PR c++/55680
// { dg-do compile { target c++11 } }
template <class T> struct X {
static void (* code ) ();
};
template <> void (* X<int>::code ) () = [](){};