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
This commit is contained in:
Jason Merrill 2011-05-27 20:53:49 -04:00 committed by Jason Merrill
parent faa0051112
commit 669baa1576
5 changed files with 31 additions and 1 deletions

View File

@ -1,5 +1,10 @@
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.

View File

@ -12672,6 +12672,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
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. */

View File

@ -8578,7 +8578,7 @@ maybe_add_lambda_conv_op (tree type)
{
/* 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);

View File

@ -1,3 +1,7 @@
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

View File

@ -0,0 +1,20 @@
// 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);
}