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/parser.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'odb/parser.cxx') 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