From c0957cfe1c73ecb6c96314e45e7d29b4199b20d6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 31 Aug 2012 10:03:45 +0200 Subject: Add support for virtual data members New test: common/virtual. --- odb/lookup.hxx | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'odb/lookup.hxx') diff --git a/odb/lookup.hxx b/odb/lookup.hxx index c207543..9e63c2a 100644 --- a/odb/lookup.hxx +++ b/odb/lookup.hxx @@ -10,6 +10,7 @@ #include #include +#include namespace lookup { @@ -45,6 +46,9 @@ namespace lookup // In this case token will be and // ptt will be CPP_SCOPE. // + // The names are appended to the 'name' variable as they are + // being resolved. + // tree resolve_scoped_name (cxx_lexer&, cpp_ttype&, @@ -56,6 +60,39 @@ namespace lookup bool is_type, bool trailing_scope = false, tree* end_scope = 0); + + // The same but using semantic graph instead of GCC tree. Also + // throws semantics::unresolved instead of unable_to_resolve. + // + semantics::node& + resolve_scoped_name (cxx_lexer&, + cpp_ttype&, + std::string& tl, // Token literal. + tree& tn, // Token node. + cpp_ttype& ptt, // Previous token type. + semantics::scope& start_scope, + std::string& name, + semantics::type_id const&, + bool trailing_scope = false, + semantics::scope** end_scope = 0); + + template + T& + resolve_scoped_name (cxx_lexer& l, + cpp_ttype& tt, + std::string& tl, // Token literal. + tree& tn, // Token node. + cpp_ttype& ptt, // Previous token type. + semantics::scope& start_scope, + std::string& name, + bool trailing_scope = false, + semantics::scope** end_scope = 0) + { + return dynamic_cast ( + resolve_scoped_name ( + l, tt, tl, tn, ptt, + start_scope, name, typeid (T), trailing_scope, end_scope)); + } } #endif // ODB_LOOKUP_HXX -- cgit v1.1