summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0359-PR-c-48284.patch
blob: 2fd1843d512eb8a9d1b0b25e1a07a3dbcb8a3bc4 (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
From a726d4116cb23c1f9873f3309c1c078d2113726d Mon Sep 17 00:00:00 2001
From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 27 May 2011 20:48:17 +0000
Subject: [PATCH] 	PR c++/48284
 	* error.c (dump_expr) [COMPONENT_REF]: Use pp_cxx_dot
 	with INDIRECT_REF of REFERENCE_TYPE.

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

index dffc764..931e24d 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1879,7 +1879,10 @@ dump_expr (tree t, int flags)
 		    && strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this")))
 	      {
 		dump_expr (ob, flags | TFF_EXPR_IN_PARENS);
-		pp_cxx_arrow (cxx_pp);
+		if (TREE_CODE (TREE_TYPE (ob)) == REFERENCE_TYPE)
+		  pp_cxx_dot (cxx_pp);
+		else
+		  pp_cxx_arrow (cxx_pp);
 	      }
 	  }
 	else
new file mode 100644
index 0000000..3515652
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/error6.C
@@ -0,0 +1,8 @@
+// PR c++/48284
+// { dg-options -std=c++0x }
+
+template<typename C>
+auto g(C& c) -> decltype (c.f()) { return c.f(); } // { dg-error "decltype .c\\.f" }
+
+template<typename C>
+auto g(C& c) -> decltype (c.f()) { return c.f(); } // { dg-error "decltype .c\\.f" }
-- 
1.7.0.4