0004-Make-compilable-with-GCC-6-in-C-14-mode.patch 1.5 KB

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