aboutsummaryrefslogtreecommitdiff
path: root/odb/lookup.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-08-31 10:03:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-08-31 10:03:45 +0200
commitc0957cfe1c73ecb6c96314e45e7d29b4199b20d6 (patch)
tree96a747f7196baa335cf83ff160527bb8333ca9e3 /odb/lookup.hxx
parented52acc5e65dd9ea2fb2d9c851c2faa61d5cb2d9 (diff)
Add support for virtual data members
New test: common/virtual.
Diffstat (limited to 'odb/lookup.hxx')
-rw-r--r--odb/lookup.hxx37
1 files changed, 37 insertions, 0 deletions
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 <string>
#include <odb/cxx-lexer.hxx>
+#include <odb/semantics/elements.hxx>
namespace lookup
{
@@ -45,6 +46,9 @@ namespace lookup
// In this case token will be <something-other-than-name> 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 <typename T>
+ 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<T&> (
+ resolve_scoped_name (
+ l, tt, tl, tn, ptt,
+ start_scope, name, typeid (T), trailing_scope, end_scope));
+ }
}
#endif // ODB_LOOKUP_HXX