diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-19 13:49:43 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-19 13:49:43 +0200 |
commit | ab132de5f11e414974cdc0c4b8d85a19792b2e47 (patch) | |
tree | 8c442ba5b350c95c9be3880623dcaab58721d077 /odb/pragma.cxx | |
parent | 0603db21d2622588ab35389d3ddcaac7410c9f11 (diff) |
Use common lookup function instead of duplicating code
Diffstat (limited to 'odb/pragma.cxx')
-rw-r--r-- | odb/pragma.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/odb/pragma.cxx b/odb/pragma.cxx index 76e2968..e41792a 100644 --- a/odb/pragma.cxx +++ b/odb/pragma.cxx @@ -213,8 +213,23 @@ resolve_scoped_name (tree& token, cxx_pragma_lexer lex; cpp_ttype ptt; // Not used. string st (lex.start (token, type)); - return lookup::resolve_scoped_name ( - st, type, ptt, lex, current_scope (), name, is_type); + + tree decl ( + lookup::resolve_scoped_name ( + st, type, ptt, lex, current_scope (), name, is_type)); + + // Get the actual type if this is a TYPE_DECL. + // + if (is_type) + { + if (TREE_CODE (decl) == TYPE_DECL) + decl = TREE_TYPE (decl); + + if (TYPE_P (decl)) // Can be a template. + decl = TYPE_MAIN_VARIANT (decl); + } + + return decl; } catch (lookup::invalid_name const&) { |