aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-04-15 11:53:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-04-15 11:53:51 +0200
commitc270ea1fa590a39f966257e8394582dccb5f5192 (patch)
tree9788272f3469fb2b018fa5ac6cab0207780e946c
parent1d3e57ff09476f53c35967c24ea9e064aed1f5aa (diff)
Try harder to find name hint for unwrapped type
-rw-r--r--odb/processor.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/odb/processor.cxx b/odb/processor.cxx
index 0a6d753..f401d3f 100644
--- a/odb/processor.cxx
+++ b/odb/processor.cxx
@@ -969,7 +969,8 @@ namespace
// The wrapped_type alias is a typedef in an instantiation
// that we just instantiated dynamically. As a result there
// is no semantic graph edges corresponding to this typedef
- // since we haven't parsed it yet. So to get the tree node
+ // since we haven't parsed it yet (unless it was instantiated
+ // explicitly by the user; see below). So to get the tree node
// that can actually be resolved to the graph node, we use
// the source type of this typedef.
//
@@ -1011,8 +1012,15 @@ namespace
// Find the hint.
//
+ // If we can't find any, then try to fallback to the wrapped_type
+ // alias inside wrapper_traits. This requires an explicit
+ // wrapper_traits instantiation (see above).
+ //
semantics::names* wh (find_hint (unit, decl));
+ if (wh == nullptr)
+ wh = unit.find_hint (TREE_TYPE (decl));
+
t.set ("wrapper-type", wt);
t.set ("wrapper-hint", wh);
}