+2019-03-25 Nathan Sidwell <nathan@acm.org>
+
+ * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
+
2019-03-22 Jakub Jelinek <jakub@redhat.com>
PR c++/60702
start_preparsed_function (statfn, NULL_TREE,
SF_PRE_PARSED | SF_INCLASS_INLINE);
- if (DECL_ONE_ONLY (statfn))
- {
- /* Put the thunk in the same comdat group as the call op. */
- cgraph_node::get_create (statfn)->add_to_same_comdat_group
- (cgraph_node::get_create (callop));
- }
tree body = begin_function_body ();
tree compound_stmt = begin_compound_stmt (0);
if (!generic_lambda_p)
+2019-03-25 Nathan Sidwell <nathan@acm.org>
+
+ * g++.dg/abi/lambda-static-1.C: New.
+
2019-03-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/89802
--- /dev/null
+// { dg-do compile { target { c++14 && comdat_group } } }
+// { dg-additional-options -fno-inline }
+
+inline auto lamby ()
+{
+ return [] {};
+}
+
+void direct ()
+{
+ lamby ()();
+}
+
+void indirect ()
+{
+ void (*invoke) () = lamby ();
+
+ invoke ();
+}
+
+// The call operator and the static invoker should be comdat, but not
+// the same group. (that would be a compiler incompatibility)
+
+// { dg-final { scan-assembler ".section\[\t ]*.text._ZZ5lambyvENKUlvE_clEv,\[^\n\r]*,_ZZ5lambyvENKUlvE_clEv,comdat" } }
+// { dg-final { scan-assembler ".section\[\t ]*.text._ZZ5lambyvENUlvE_4_FUNEv,\[^\n\r]*,_ZZ5lambyvENUlvE_4_FUNEv,comdat" } }