From 3d9bd015b1c14ae2b663c2d95f52e2c117847c72 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Feb 2013 13:46:17 +0200 Subject: Work around odd GCC tree behavior --- odb/context.cxx | 2 -- odb/parser.cxx | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'odb') diff --git a/odb/context.cxx b/odb/context.cxx index f0a169e..9b8cb3c 100644 --- a/odb/context.cxx +++ b/odb/context.cxx @@ -1721,9 +1721,7 @@ find (semantics::type& t, semantics::names* hint) // interested in, go into nested hints. // for (; hint != 0 && i == e; hint = hint->hint ()) - { i = base::find (t.fq_name (hint)); - } // If the hinted name didn't work, try the primary name (e.g., // ::std::string) instead of a user typedef (e.g., my_string). diff --git a/odb/parser.cxx b/odb/parser.cxx index 3bf2832..14dd81a 100644 --- a/odb/parser.cxx +++ b/odb/parser.cxx @@ -1128,8 +1128,6 @@ emit_type_decl (tree decl) // class typedef case described above since we already used // this name to define the class. // - int tc (TREE_CODE (t)); - if ((tc == RECORD_TYPE || tc == UNION_TYPE || tc == ENUMERAL_TYPE) && TYPE_NAME (TYPE_MAIN_VARIANT (t)) == decl) return 0; @@ -1155,8 +1153,10 @@ emit_type_decl (tree decl) // typedef foo bar; // typedef bar foo; // - if (unit_->find_hint (t) == 0) - unit_->insert_hint (t, edge); + // GCC also appears to re-purpose a node for another name (not + // sure if its a bug or a feature), so use the latest seen name. + // + unit_->insert_hint (t, edge); if (trace) { -- cgit v1.1