diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0333-PR-c-45080.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0333-PR-c-45080.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0333-PR-c-45080.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0333-PR-c-45080.patch new file mode 100644 index 0000000000..9f585c75ba --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0333-PR-c-45080.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From f6c71a6aa6e71a5dde50a13377d8ebd1a41aa9ab Mon Sep 17 00:00:00 2001 | ||
2 | From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Wed, 25 May 2011 15:26:25 +0000 | ||
4 | Subject: [PATCH] PR c++/45080 | ||
5 | * pt.c (instantiate_class_template_1): Call maybe_add_lambda_conv_op. | ||
6 | * semantics.c (lambda_function): Check COMPLETE_OR_OPEN_TYPE_P. | ||
7 | |||
8 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174208 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
9 | |||
10 | index d379a8c..c5f2422 100644 | ||
11 | --- a/gcc/cp/pt.c | ||
12 | +++ b/gcc/cp/pt.c | ||
13 | @@ -8557,6 +8557,9 @@ instantiate_class_template (tree type) | ||
14 | } | ||
15 | } | ||
16 | |||
17 | + if (CLASSTYPE_LAMBDA_EXPR (type)) | ||
18 | + maybe_add_lambda_conv_op (type); | ||
19 | + | ||
20 | /* Set the file and line number information to whatever is given for | ||
21 | the class itself. This puts error messages involving generated | ||
22 | implicit functions at a predictable point, and the same point | ||
23 | diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c | ||
24 | index 6207b12..b113626 100644 | ||
25 | --- a/gcc/cp/semantics.c | ||
26 | +++ b/gcc/cp/semantics.c | ||
27 | @@ -8086,7 +8086,8 @@ lambda_function (tree lambda) | ||
28 | type = lambda; | ||
29 | gcc_assert (LAMBDA_TYPE_P (type)); | ||
30 | /* Don't let debug_tree cause instantiation. */ | ||
31 | - if (CLASSTYPE_TEMPLATE_INSTANTIATION (type) && !COMPLETE_TYPE_P (type)) | ||
32 | + if (CLASSTYPE_TEMPLATE_INSTANTIATION (type) | ||
33 | + && !COMPLETE_OR_OPEN_TYPE_P (type)) | ||
34 | return NULL_TREE; | ||
35 | lambda = lookup_member (type, ansi_opname (CALL_EXPR), | ||
36 | /*protect=*/0, /*want_type=*/false); | ||
37 | new file mode 100644 | ||
38 | index 0000000..53d8e99 | ||
39 | --- /dev/null | ||
40 | +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv5.C | ||
41 | @@ -0,0 +1,15 @@ | ||
42 | +// PR c++/45080 | ||
43 | +// { dg-options -std=c++0x } | ||
44 | + | ||
45 | +typedef void(*pfn)(); | ||
46 | + | ||
47 | +template<typename=int> | ||
48 | +void f() | ||
49 | +{ | ||
50 | + pfn fn = []{}; | ||
51 | +} | ||
52 | + | ||
53 | +void test() | ||
54 | +{ | ||
55 | + f(); | ||
56 | +} | ||
57 | -- | ||
58 | 1.7.0.4 | ||
59 | |||