summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0156-PR-c-48657.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2011-04-30 12:37:47 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-05 12:26:41 +0100
commit478deec11f3349d61b1a922f047dc958dc07262a (patch)
tree1843907b36de2bcb8f821d49d8c9a88014ef0dc7 /meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0156-PR-c-48657.patch
parentd42dccf886983ba14ccc868041d7bea0cf1a260e (diff)
downloadpoky-478deec11f3349d61b1a922f047dc958dc07262a.tar.gz
gcc-4.6.0: Backport FSF 4.6 branch patches
This is set of bugfixes that has been done on FSF gcc-4_2-branch since 4.6.0 was released They will roll into 4.6.1 release once that happens in coming approx 6 months time then we can simply remove them thats the reason so use a separate .inc file to define the SRC_URI additions (From OE-Core rev: b0d5b9f12adbce2c4a0df6059f5671188cd32293) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0156-PR-c-48657.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0156-PR-c-48657.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0156-PR-c-48657.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0156-PR-c-48657.patch
new file mode 100644
index 0000000000..8f5cbafaea
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0156-PR-c-48657.patch
@@ -0,0 +1,58 @@
1From 03be58e53f230926009974bd7aed6a40a557dc1d Mon Sep 17 00:00:00 2001
2From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Wed, 20 Apr 2011 19:39:26 +0000
4Subject: [PATCH 156/200] PR c++/48657
5 * decl.c (cp_finish_decl): Handle non-member constant variables
6 in templates, too.
7
8git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172791 138bc75d-0d04-0410-961f-82ee72b054a4
9
10index 41beef3..61b57ea 100644
11--- a/gcc/cp/decl.c
12+++ b/gcc/cp/decl.c
13@@ -5862,11 +5862,9 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
14 then it can be used in future constant expressions, so its value
15 must be available. */
16 if (!(init
17- && DECL_CLASS_SCOPE_P (decl)
18- /* We just set TREE_CONSTANT appropriately; see above. */
19- && TREE_CONSTANT (decl)
20+ && init_const_expr_p
21 && !type_dependent_p
22- /* FIXME non-value-dependent constant expression */
23+ && decl_maybe_constant_var_p (decl)
24 && !value_dependent_init_p (init)))
25 {
26 if (init)
27@@ -5878,6 +5876,14 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
28 goto finish_end;
29 }
30
31+ if (!DECL_CLASS_SCOPE_P (decl))
32+ {
33+ tree init_code = check_initializer (decl, init, flags, &cleanup);
34+ if (init_code)
35+ DECL_INITIAL (decl) = init;
36+ goto finish_end;
37+ }
38+
39 if (TREE_CODE (init) == TREE_LIST)
40 {
41 /* If the parenthesized-initializer form was used (e.g.,
42new file mode 100644
43index 0000000..6552ec6
44--- /dev/null
45+++ b/gcc/testsuite/g++.dg/template/const4.C
46@@ -0,0 +1,9 @@
47+// PR c++/48657
48+
49+template<unsigned> struct A { typedef int T; };
50+
51+template<unsigned> void f()
52+{
53+ const unsigned D = 4;
54+ A<D>::T t;
55+}
56--
571.7.0.4
58