aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-02-12 13:46:17 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-02-12 13:46:17 +0200
commit3d9bd015b1c14ae2b663c2d95f52e2c117847c72 (patch)
tree68696a8892fd3e36ebca3a89cdc551026262c968
parent74f3738ad44950317490d91b7e2c31c54c2c3d5c (diff)
Work around odd GCC tree behavior2.2.0
-rw-r--r--odb/context.cxx2
-rw-r--r--odb/parser.cxx8
2 files changed, 4 insertions, 6 deletions
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)
{