summaryrefslogtreecommitdiff
path: root/odb/parser.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-11-07 14:58:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-11-07 14:58:43 +0200
commit356630ced28f3101e8e2d88e3c52f8d3008515c7 (patch)
tree6950cfd3797bbe34e375c223e4226666fef69202 /odb/parser.cxx
parentbc1616e3e45967ccec892d14a9337554238ca332 (diff)
Adapt to changes in GCC 8
Diffstat (limited to 'odb/parser.cxx')
-rw-r--r--odb/parser.cxx27
1 files changed, 26 insertions, 1 deletions
diff --git a/odb/parser.cxx b/odb/parser.cxx
index 79a5bc2..304be98 100644
--- a/odb/parser.cxx
+++ b/odb/parser.cxx
@@ -911,8 +911,23 @@ collect (tree ns)
// Traverse namespaces.
//
- for (decl = level->namespaces; decl != NULL_TREE; decl = TREE_CHAIN (decl))
+ for (
+#if BUILDING_GCC_MAJOR >= 8
+ decl = level->names;
+#else
+ decl = level->namespaces;
+#endif
+ decl != NULL_TREE;
+ decl = TREE_CHAIN (decl))
{
+#if BUILDING_GCC_MAJOR >= 8
+ // Now namespaces are interleaved with other declarations. In fact, we
+ // could probably collect everything in a single pass.
+ //
+ if (TREE_CODE (decl) != NAMESPACE_DECL)
+ continue;
+#endif
+
if (!DECL_IS_BUILTIN (decl) || DECL_NAMESPACE_STD_P (decl))
{
if (trace)
@@ -986,9 +1001,15 @@ emit ()
// approximation for this namespace origin. Also resolve
// the tree node for this namespace.
//
+#if BUILDING_GCC_MAJOR >= 8
+ tree tree_node (
+ get_namespace_binding (
+ scope_->tree_node (), get_identifier (n.c_str ())));
+#else
tree tree_node (
namespace_binding (
get_identifier (n.c_str ()), scope_->tree_node ()));
+#endif
namespace_& node (unit_->new_node<namespace_> (f, l, c, tree_node));
unit_->new_edge<defines> (*scope_, node, n);
@@ -2244,7 +2265,11 @@ fq_scope (tree decl)
// If this is an inline namespace, pretend it doesn't exist.
//
+#if BUILDING_GCC_MAJOR >= 8
+ if (!is_nested_namespace (prev, scope, true))
+#else
if (!is_associated_namespace (prev, scope))
+#endif
{
tree n = DECL_NAME (scope);