From 356630ced28f3101e8e2d88e3c52f8d3008515c7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Nov 2017 14:58:43 +0200 Subject: Adapt to changes in GCC 8 --- odb/parser.cxx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'odb/parser.cxx') 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 (f, l, c, tree_node)); unit_->new_edge (*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); -- cgit v1.1