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:
parent
561f7fc72c
commit
e75e98f270
@ -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.
|
||||
|
@ -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",
|
||||
|
7
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template8.C
Normal file
7
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template8.C
Normal 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 ) () = [](){};
|
Loading…
x
Reference in New Issue
Block a user