From 478deec11f3349d61b1a922f047dc958dc07262a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 30 Apr 2011 12:37:47 -0700 Subject: 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 Signed-off-by: Richard Purdie --- .../gcc-4_6-branch-backports/0156-PR-c-48657.patch | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0156-PR-c-48657.patch (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0156-PR-c-48657.patch') 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 @@ +From 03be58e53f230926009974bd7aed6a40a557dc1d Mon Sep 17 00:00:00 2001 +From: jason +Date: Wed, 20 Apr 2011 19:39:26 +0000 +Subject: [PATCH 156/200] PR c++/48657 + * decl.c (cp_finish_decl): Handle non-member constant variables + in templates, too. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172791 138bc75d-0d04-0410-961f-82ee72b054a4 + +index 41beef3..61b57ea 100644 +--- a/gcc/cp/decl.c ++++ b/gcc/cp/decl.c +@@ -5862,11 +5862,9 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p, + then it can be used in future constant expressions, so its value + must be available. */ + if (!(init +- && DECL_CLASS_SCOPE_P (decl) +- /* We just set TREE_CONSTANT appropriately; see above. */ +- && TREE_CONSTANT (decl) ++ && init_const_expr_p + && !type_dependent_p +- /* FIXME non-value-dependent constant expression */ ++ && decl_maybe_constant_var_p (decl) + && !value_dependent_init_p (init))) + { + if (init) +@@ -5878,6 +5876,14 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p, + goto finish_end; + } + ++ if (!DECL_CLASS_SCOPE_P (decl)) ++ { ++ tree init_code = check_initializer (decl, init, flags, &cleanup); ++ if (init_code) ++ DECL_INITIAL (decl) = init; ++ goto finish_end; ++ } ++ + if (TREE_CODE (init) == TREE_LIST) + { + /* If the parenthesized-initializer form was used (e.g., +new file mode 100644 +index 0000000..6552ec6 +--- /dev/null ++++ b/gcc/testsuite/g++.dg/template/const4.C +@@ -0,0 +1,9 @@ ++// PR c++/48657 ++ ++template struct A { typedef int T; }; ++ ++template void f() ++{ ++ const unsigned D = 4; ++ A::T t; ++} +-- +1.7.0.4 + -- cgit v1.2.3-54-g00ecf