PR c++/47049
* semantics.c (maybe_add_lambda_conv_op): Fix COMDAT sharing.
* decl.c (start_preparsed_function): Don't call comdat_linkage for
a template.
From-SVN: r174375
2011-05-27 Jason Merrill <jason@redhat.com>
+ PR c++/47049
+ * semantics.c (maybe_add_lambda_conv_op): Fix COMDAT sharing.
+ * decl.c (start_preparsed_function): Don't call comdat_linkage for
+ a template.
+
PR c++/47132
* mangle.c (write_expression): Handle MODOP_EXPR.
DECL_EXTERNAL (decl1) = 0;
if (ctx != NULL_TREE && DECL_DECLARED_INLINE_P (ctx)
+ && !processing_template_decl
&& TREE_PUBLIC (ctx))
/* This is a function in a local class in an extern inline
function. */
{
/* Put the thunk in the same comdat group as the call op. */
struct cgraph_node *callop_node, *thunk_node;
- DECL_COMDAT_GROUP (statfn) = DECL_COMDAT_GROUP (callop);
+ DECL_COMDAT_GROUP (statfn) = cxx_comdat_group (callop);
callop_node = cgraph_get_create_node (callop);
thunk_node = cgraph_get_create_node (statfn);
gcc_assert (callop_node->same_comdat_group == NULL);
+2011-05-27 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/lambda/lambda-template2.C: New.
+
2011-05-27 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
--- /dev/null
+// PR c++/47049
+// { dg-options -std=c++0x }
+
+enum { E = 0, F = 1 };
+template <int N, int M = ((N == 1) ? F : E)> class S {};
+template <int N>
+struct T
+{
+ static void
+ foo (S<N> *p)
+ {
+ S<N> u;
+ [&u] ()->bool {} ();
+ }
+};
+
+int main()
+{
+ T<0>().foo(0);
+}