summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0104-PR-c-48523.patch
blob: 62bd4f93bac844fbc57f3ac257facc46e28c58d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 514b92d849b08f3fb7a8194a822b0b8609776564 Mon Sep 17 00:00:00 2001
From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 12 Apr 2011 00:20:18 +0000
Subject: [PATCH 104/200] 	PR c++/48523
 	* tree.c (maybe_dummy_object): Use build_x_indirect_ref rather
 	than cp_build_indirect_ref.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172293 138bc75d-0d04-0410-961f-82ee72b054a4

index 56639ff..15ee741 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2421,7 +2421,7 @@ maybe_dummy_object (tree type, tree* binfop)
   else if (current != current_class_type
 	   && context == nonlambda_method_basetype ())
     /* In a lambda, need to go through 'this' capture.  */
-    decl = (cp_build_indirect_ref
+    decl = (build_x_indirect_ref
 	    ((lambda_expr_this_capture
 	      (CLASSTYPE_LAMBDA_EXPR (current_class_type))),
 	     RO_NULL, tf_warning_or_error));
new file mode 100644
index 0000000..29cd2a9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this4.C
@@ -0,0 +1,13 @@
+// PR c++/48523
+// { dg-options -std=c++0x }
+
+template<typename>
+struct X
+{
+  bool b;
+
+  void f()
+  {
+    [this]{ return b; };
+  }
+};
-- 
1.7.0.4

OpenPOWER on IntegriCloud