~ubuntu-branches/ubuntu/quantal/gcc-4.7/quantal

« back to all changes in this revision

Viewing changes to debian/patches/pr53599.diff

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-06-23 13:26:03 UTC
  • mfrom: (1.2.2) (15.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20120623132603-an0rern75d19bqx0
Tags: 4.7.1-2ubuntu1
Update the Linaro support to the 4.7-2012.06 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# DP: Fix PR c++/53599 (reverting the fix for PR c++/53137)
2
 
 
3
 
--- a/src/gcc/cp/ChangeLog
4
 
+++ b/src/gcc/cp/ChangeLog
5
 
@@ -17,11 +17,6 @@
6
 
 
7
 
 2012-06-01  Jason Merrill  <jason@redhat.com>
8
 
 
9
 
-       PR c++/53137
10
 
-       * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
11
 
-       (instantiate_decl): Don't push_to_top_level for local class methods.
12
 
-       (instantiate_class_template_1): Or for local classes.
13
 
-
14
 
        PR c++/53484
15
 
        * pt.c (do_auto_deduction): Don't try to deduce from a
16
 
        type-dependent initializer.
17
 
--- a/src/gcc/cp/pt.c
18
 
+++ b/src/gcc/cp/pt.c
19
 
@@ -8734,7 +8734,6 @@
20
 
   tree pbinfo;
21
 
   tree base_list;
22
 
   unsigned int saved_maximum_field_alignment;
23
 
-  tree fn_context;
24
 
 
25
 
   if (type == error_mark_node)
26
 
     return error_mark_node;
27
 
@@ -8793,9 +8792,7 @@
28
 
      it now.  */
29
 
   push_deferring_access_checks (dk_no_deferred);
30
 
 
31
 
-  fn_context = decl_function_context (TYPE_MAIN_DECL (type));
32
 
-  if (!fn_context)
33
 
-    push_to_top_level ();
34
 
+  push_to_top_level ();
35
 
   /* Use #pragma pack from the template context.  */
36
 
   saved_maximum_field_alignment = maximum_field_alignment;
37
 
   maximum_field_alignment = TYPE_PRECISION (pattern);
38
 
@@ -9194,14 +9191,8 @@
39
 
              apply_lambda_return_type (lambda, void_type_node);
40
 
              LAMBDA_EXPR_RETURN_TYPE (lambda) = NULL_TREE;
41
 
            }
42
 
-
43
 
-         LAMBDA_EXPR_THIS_CAPTURE (lambda)
44
 
-           = lookup_field_1 (type, get_identifier ("__this"), false);
45
 
-
46
 
          instantiate_decl (decl, false, false);
47
 
          maybe_add_lambda_conv_op (type);
48
 
-
49
 
-         LAMBDA_EXPR_THIS_CAPTURE (lambda) = NULL_TREE;
50
 
        }
51
 
       else
52
 
        gcc_assert (errorcount);
53
 
@@ -9232,8 +9223,7 @@
54
 
   perform_deferred_access_checks ();
55
 
   pop_nested_class ();
56
 
   maximum_field_alignment = saved_maximum_field_alignment;
57
 
-  if (!fn_context)
58
 
-    pop_from_top_level ();
59
 
+  pop_from_top_level ();
60
 
   pop_deferring_access_checks ();
61
 
   pop_tinst_level ();
62
 
 
63
 
@@ -18466,10 +18456,9 @@
64
 
   tree spec;
65
 
   tree gen_tmpl;
66
 
   bool pattern_defined;
67
 
+  int need_push;
68
 
   location_t saved_loc = input_location;
69
 
   bool external_p;
70
 
-  tree fn_context;
71
 
-  bool nested;
72
 
 
73
 
   /* This function should only be used to instantiate templates for
74
 
      functions and static member variables.  */
75
 
@@ -18704,12 +18693,9 @@
76
 
        goto out;
77
 
     }
78
 
 
79
 
-  fn_context = decl_function_context (d);
80
 
-  nested = (current_function_decl != NULL_TREE);
81
 
-  if (!fn_context)
82
 
+  need_push = !cfun || !global_bindings_p ();
83
 
+  if (need_push)
84
 
     push_to_top_level ();
85
 
-  else if (nested)
86
 
-    push_function_context ();
87
 
 
88
 
   /* Mark D as instantiated so that recursive calls to
89
 
      instantiate_decl do not try to instantiate it again.  */
90
 
@@ -18822,10 +18808,8 @@
91
 
   /* We're not deferring instantiation any more.  */
92
 
   TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (d)) = 0;
93
 
 
94
 
-  if (!fn_context)
95
 
+  if (need_push)
96
 
     pop_from_top_level ();
97
 
-  else if (nested)
98
 
-    pop_function_context ();
99
 
 
100
 
 out:
101
 
   input_location = saved_loc;
102
 
--- a/src/gcc/testsuite/ChangeLog
103
 
+++ b/src/gcc/testsuite/ChangeLog
104
 
@@ -60,11 +60,6 @@
105
 
 
106
 
 2012-06-01  Jason Merrill  <jason@redhat.com>
107
 
 
108
 
-       PR c++/53137
109
 
-       * g++.dg/cpp0x/lambda/lambda-template5.C: New.
110
 
-
111
 
-2012-06-01  Jason Merrill  <jason@redhat.com>
112
 
-
113
 
        PR c++/53484
114
 
        * g++.dg/cpp0x/auto33.C: New.
115
 
 
116
 
--- a/src/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C
117
 
+++ b/src/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C
118
 
@@ -1,17 +0,0 @@
119
 
-// PR c++/53137
120
 
-// { dg-do compile { target c++11 } }
121
 
-
122
 
-struct A
123
 
-{
124
 
-  template <typename T> void f();
125
 
-
126
 
-  template <typename T> void g()
127
 
-  {
128
 
-    [this]{ f<T>(); }();
129
 
-  }
130
 
-
131
 
-  void h()
132
 
-  {
133
 
-    g<int>();
134
 
-  }
135
 
-};