diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-12-28 11:01:06 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-12-28 11:01:06 +0200 |
commit | 1f87ed70f983bc0fb920a0e1360de0977fe10c9f (patch) | |
tree | 27a46e525d178b08ed6d0de66dace9368275ef2c /odb/parser.cxx | |
parent | ec777147024fde72e4411cc6b1e1e49f4a1d1804 (diff) |
Fix GCC 6 issue with PRAGMA_DB macro
In GCC 6 we use the position of the macro expansion, not the position inside
the macro itself. This means that multiple pragmas inside PRAGMA_DB will all
have the same position which we were not handling properly.
Diffstat (limited to 'odb/parser.cxx')
-rw-r--r-- | odb/parser.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/odb/parser.cxx b/odb/parser.cxx index 6dfff6f..079f6f3 100644 --- a/odb/parser.cxx +++ b/odb/parser.cxx @@ -852,12 +852,12 @@ parse (tree global_scope, path const& main_file) } pragma_set& s (decl_pragmas_[ns]); - pragma_set::iterator it (s.find (p)); + pragma_set::iterator it (s.find (p.context_name)); // Make sure we override only if this pragma came after the one // already in the set. // - if (it == s.end () || it->loc < p.loc) + if (it == s.end () || it->second.loc <= p.loc) s.insert (p); } @@ -2179,7 +2179,7 @@ process_pragmas (declaration const& decl, // Finally, copy the resulting pragma set to context. // for (pragma_set::iterator i (prags.begin ()); i != prags.end (); ++i) - add_pragma (node, *i); + add_pragma (node, i->second); } void parser::impl:: @@ -2195,7 +2195,7 @@ process_named_pragmas (declaration const& decl, node& node) // Copy the resulting pragma set to context. // for (pragma_set::iterator i (prags.begin ()); i != prags.end (); ++i) - add_pragma (node, *i); + add_pragma (node, i->second); } void parser::impl:: |