commit 1631ee6dca428836c7733e5d78e8644af2058ae7
Author: Jason Merrill <jason@redhat.com>
Date: Wed Feb 13 13:25:20 2013 -0500
PR c++/55680
* pt.c (maybe_process_partial_specialization): A lambda
isn't what's being specialized.
@@ -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",
new file mode 100644
@@ -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 ) () = [](){};