0005-Fix-bug-in-GCC-6-input_location-translation.patch 985 B

12345678910111213141516171819202122232425262728293031323334
  1. From 029687831099bf1dcc944517f9e48af1db5b0361 Mon Sep 17 00:00:00 2001
  2. From: Boris Kolpackov <boris@codesynthesis.com>
  3. Date: Fri, 23 Dec 2016 10:18:01 +0200
  4. Subject: [PATCH] Fix bug in GCC 6 input_location translation
  5. [Upstream: ec777147024fde72e4411cc6b1e1e49f4a1d1804]
  6. Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
  7. ---
  8. odb/cxx-lexer.cxx | 8 ++++++++
  9. 1 file changed, 8 insertions(+)
  10. diff --git a/odb/cxx-lexer.cxx b/odb/cxx-lexer.cxx
  11. index 64df296..ae045d9 100644
  12. --- a/odb/cxx-lexer.cxx
  13. +++ b/odb/cxx-lexer.cxx
  14. @@ -106,7 +106,15 @@ next (string& token, tree* node)
  15. location_t cxx_pragma_lexer::
  16. location () const
  17. {
  18. + // Starting from GCC 6 the input location seem to require the same
  19. + // translation as what we do in real_source_location().
  20. + //
  21. +#if BUILDING_GCC_MAJOR >= 6
  22. + return linemap_resolve_location (
  23. + line_table, input_location, LRK_MACRO_EXPANSION_POINT, 0);
  24. +#else
  25. return input_location;
  26. +#endif
  27. }
  28. string cxx_pragma_lexer::
  29. --
  30. 2.25.0