re PR c++/53821 ([c++11] multiple definitions of lambda)

PR c++/53821
	* semantics.c (maybe_add_lambda_conv_op): Don't set
	DECL_INTERFACE_KNOWN.

From-SVN: r189176
This commit is contained in:
Jason Merrill 2012-07-02 15:14:58 -04:00 committed by Jason Merrill
parent 1f870a36f8
commit c34d9e8133
4 changed files with 25 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2012-07-02 Jason Merrill <jason@redhat.com>
PR c++/53821
* semantics.c (maybe_add_lambda_conv_op): Don't set
DECL_INTERFACE_KNOWN.
2012-06-27 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/51214

View File

@ -9272,8 +9272,6 @@ maybe_add_lambda_conv_op (tree type)
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_DECLARED_INLINE_P (fn) = 1;
DECL_ARGUMENTS (fn) = build_this_parm (fntype, TYPE_QUAL_CONST);
if (nested)
DECL_INTERFACE_KNOWN (fn) = 1;
add_method (type, fn, NULL_TREE);
@ -9304,8 +9302,6 @@ maybe_add_lambda_conv_op (tree type)
DECL_ARGUMENTS (fn) = copy_list (DECL_CHAIN (DECL_ARGUMENTS (callop)));
for (arg = DECL_ARGUMENTS (fn); arg; arg = DECL_CHAIN (arg))
DECL_CONTEXT (arg) = fn;
if (nested)
DECL_INTERFACE_KNOWN (fn) = 1;
add_method (type, fn, NULL_TREE);

View File

@ -1,3 +1,8 @@
2012-07-02 Jason Merrill <jason@redhat.com>
PR c++/53821
* g++.dg/cpp0x/lambda/lambda-template6.C: New.
2012-06-29 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
Backport from mainline.

View File

@ -0,0 +1,14 @@
// PR c++/53821
// { dg-final { scan-assembler-not "_ZZ1fIvEvvENKUlvE_cvPFvvEEv" } }
// { dg-do compile { target c++11 } }
template <class T> void f()
{
auto g = []{};
g();
}
int main()
{
f<void>();
}