re PR c++/43016 ([C++0x] Inappropriate multiple definition error for lambda function when inside inline functions)

PR c++/43016
	* semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.

From-SVN: r156671
This commit is contained in:
Jason Merrill 2010-02-10 16:48:25 -05:00 committed by Jason Merrill
parent 56592e03b4
commit 7a79ff3be3
4 changed files with 24 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2010-02-10 Jason Merrill <jason@redhat.com>
PR c++/43016
* semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
* Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.

View File

@ -5871,6 +5871,8 @@ maybe_add_lambda_conv_op (tree type)
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_DECLARED_INLINE_P (fn) = 1;
DECL_STATIC_FUNCTION_P (fn) = 1;
if (nested)
DECL_INTERFACE_KNOWN (fn) = 1;
add_method (type, fn, NULL_TREE);

View File

@ -1,3 +1,8 @@
2010-02-10 Jason Merrill <jason@redhat.com>
PR c++/43016
* g++.dg/cpp0x/lambda/lambda-conv.C: Test for weakness.
2010-02-10 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43017

View File

@ -1,6 +1,16 @@
// { dg-options -std=c++0x }
// Test for conversion from stateless lambda to function pointer, which is
// not yet part of the draft but hopefully will be after the March 2010
// meeting.
int main()
// { dg-options -std=c++0x }
// { dg-final { scan-assembler "weak\[^\n\r\]*_?_ZZ1fvENUlvE_cvPFvvEEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin } } } } }
inline void f()
{
void (*pfn)() = []{};
}
int main()
{
f();
}