From c270ea1fa590a39f966257e8394582dccb5f5192 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 15 Apr 2018 11:53:51 +0200 Subject: Try harder to find name hint for unwrapped type --- odb/processor.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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); } -- cgit v1.1