summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0218-PR-c-48749.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0218-PR-c-48749.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0218-PR-c-48749.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0218-PR-c-48749.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0218-PR-c-48749.patch
new file mode 100644
index 0000000000..1caa36a4f7
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0218-PR-c-48749.patch
@@ -0,0 +1,59 @@
1From 0a32d85a09c354725c2c18fb7ac42d2809197070 Mon Sep 17 00:00:00 2001
2From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Thu, 5 May 2011 02:51:01 +0000
4Subject: [PATCH] PR c++/48749
5 * class.c (resolves_to_fixed_type_p): Don't look closely
6 in templates.
7
8git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@173414 138bc75d-0d04-0410-961f-82ee72b054a4
9
10index d19610a..c833329 100644
11--- a/gcc/cp/class.c
12+++ b/gcc/cp/class.c
13@@ -5978,7 +5978,17 @@ resolves_to_fixed_type_p (tree instance, int* nonnull)
14 {
15 tree t = TREE_TYPE (instance);
16 int cdtorp = 0;
17- tree fixed = fixed_type_or_null (instance, nonnull, &cdtorp);
18+ tree fixed;
19+
20+ if (processing_template_decl)
21+ {
22+ /* In a template we only care about the type of the result. */
23+ if (nonnull)
24+ *nonnull = true;
25+ return true;
26+ }
27+
28+ fixed = fixed_type_or_null (instance, nonnull, &cdtorp);
29 if (fixed == NULL_TREE)
30 return 0;
31 if (POINTER_TYPE_P (t))
32new file mode 100644
33index 0000000..e236504
34--- /dev/null
35+++ b/gcc/testsuite/g++.dg/conversion/base1.C
36@@ -0,0 +1,20 @@
37+// PR c++/48749
38+
39+struct Tuple3
40+{
41+ float x;
42+};
43+
44+struct Pos: virtual Tuple3 { };
45+
46+struct TexCoords
47+{
48+ Pos pos;
49+};
50+
51+template <class T>
52+void eval (const TexCoords &coords)
53+{
54+ const Pos &pos = coords.pos;
55+ pos.x;
56+}
57--
581.7.0.4
59