Commit 669baa15 by Jason Merrill Committed by Jason Merrill

re PR c++/47049 ([C++0x] ICE in write_unnamed_type_name with lambda use)

	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
parent faa00511
2011-05-27 Jason Merrill <jason@redhat.com> 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 PR c++/47132
* mangle.c (write_expression): Handle MODOP_EXPR. * mangle.c (write_expression): Handle MODOP_EXPR.
......
...@@ -12672,6 +12672,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) ...@@ -12672,6 +12672,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
DECL_EXTERNAL (decl1) = 0; DECL_EXTERNAL (decl1) = 0;
if (ctx != NULL_TREE && DECL_DECLARED_INLINE_P (ctx) if (ctx != NULL_TREE && DECL_DECLARED_INLINE_P (ctx)
&& !processing_template_decl
&& TREE_PUBLIC (ctx)) && TREE_PUBLIC (ctx))
/* This is a function in a local class in an extern inline /* This is a function in a local class in an extern inline
function. */ function. */
......
...@@ -8578,7 +8578,7 @@ maybe_add_lambda_conv_op (tree type) ...@@ -8578,7 +8578,7 @@ maybe_add_lambda_conv_op (tree type)
{ {
/* Put the thunk in the same comdat group as the call op. */ /* Put the thunk in the same comdat group as the call op. */
struct cgraph_node *callop_node, *thunk_node; 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); callop_node = cgraph_get_create_node (callop);
thunk_node = cgraph_get_create_node (statfn); thunk_node = cgraph_get_create_node (statfn);
gcc_assert (callop_node->same_comdat_group == NULL); 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> 2011-05-27 Tobias Burnus <burnus@net-b.de>
PR fortran/18918 PR fortran/18918
......
// 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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment