xref: /OK3568_Linux_fs/buildroot/package/odb/0004-Make-compilable-with-GCC-6-in-C-14-mode.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunFrom 4584b69c45b701c3689d6a974f1ee560a79a243e Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Boris Kolpackov <boris@codesynthesis.com>
3*4882a593SmuzhiyunDate: Mon, 8 Feb 2016 18:39:21 +0200
4*4882a593SmuzhiyunSubject: [PATCH] Make compilable with GCC 6 in C++14 mode
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun[Upstream: 61d13eb53ade9f30a64892a901401bda5e42c335]
7*4882a593SmuzhiyunSigned-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
8*4882a593Smuzhiyun---
9*4882a593Smuzhiyun odb/gcc.hxx    | 9 ++++++---
10*4882a593Smuzhiyun odb/parser.cxx | 2 ++
11*4882a593Smuzhiyun 2 files changed, 8 insertions(+), 3 deletions(-)
12*4882a593Smuzhiyun
13*4882a593Smuzhiyundiff --git a/odb/gcc.hxx b/odb/gcc.hxx
14*4882a593Smuzhiyunindex 858d685..a22357d 100644
15*4882a593Smuzhiyun--- a/odb/gcc.hxx
16*4882a593Smuzhiyun+++ b/odb/gcc.hxx
17*4882a593Smuzhiyun@@ -7,9 +7,12 @@
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun #include <odb/gcc-fwd.hxx>
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun-#if BUILDING_GCC_MAJOR >= 6
22*4882a593Smuzhiyun-#  include <safe-ctype.h> // See gcc-fwd.hxx.
23*4882a593Smuzhiyun-#endif
24*4882a593Smuzhiyun+// Actually, let's keep it out. With it included we can compile in C++98
25*4882a593Smuzhiyun+// but not in C++14 (GCC 6 default).
26*4882a593Smuzhiyun+//
27*4882a593Smuzhiyun+// #if BUILDING_GCC_MAJOR >= 6
28*4882a593Smuzhiyun+// #  include <safe-ctype.h> // See gcc-fwd.hxx.
29*4882a593Smuzhiyun+// #endif
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun // GCC header includes to get the plugin and parse tree declarations.
32*4882a593Smuzhiyun // The order is important and doesn't follow any kind of logic.
33*4882a593Smuzhiyundiff --git a/odb/parser.cxx b/odb/parser.cxx
34*4882a593Smuzhiyunindex feda9d4..a9d22fb 100644
35*4882a593Smuzhiyun--- a/odb/parser.cxx
36*4882a593Smuzhiyun+++ b/odb/parser.cxx
37*4882a593Smuzhiyun@@ -1831,6 +1831,8 @@ create_type (tree t,
38*4882a593Smuzhiyun       // the array type. In other words, we view it as "constant array"
39*4882a593Smuzhiyun       // rather than "array of constant elements".
40*4882a593Smuzhiyun       //
41*4882a593Smuzhiyun+      using semantics::array; // vs std::array.
42*4882a593Smuzhiyun+
43*4882a593Smuzhiyun       tree bt (TREE_TYPE (t));
44*4882a593Smuzhiyun       tree bt_mv (TYPE_MAIN_VARIANT (bt));
45*4882a593Smuzhiyun       type& bt_node (emit_type (bt_mv, access::public_, file, line, clmn));
46*4882a593Smuzhiyun--
47*4882a593Smuzhiyun2.25.0
48*4882a593Smuzhiyun
49