summaryrefslogtreecommitdiff
path: root/odb/relational/source.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-09-29 11:33:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-09-29 11:33:08 +0200
commit1095648630d3b8d67c94d84004da085a5a93fc0d (patch)
tree298c90a488b4b3ec26e550611c216abb7c274b60 /odb/relational/source.cxx
parent7ac7872103a868f4232f4284aeefc1762bd75a89 (diff)
Initial take on virtual see-through memberssee_through_member
Notes: 1. Probably better to have a separate marker, like transient. 2. No reason to limit this to virtual members. 3. Probably makes sense to also automatically set column to empty.
Diffstat (limited to 'odb/relational/source.cxx')
-rw-r--r--odb/relational/source.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/odb/relational/source.cxx b/odb/relational/source.cxx
index e9ddd77..d32a52a 100644
--- a/odb/relational/source.cxx
+++ b/odb/relational/source.cxx
@@ -5881,8 +5881,6 @@ namespace relational
}
expression e (vo);
- r += "::";
- r += ctx.public_name (*m);
// Assemble the member path if we may need to return a pointer
// expression.
@@ -5894,6 +5892,7 @@ namespace relational
// Finally, resolve nested members if any.
//
+ bool first (true);
for (; tt == CPP_DOT; ptt = tt, tt = l.next (tl, &tn))
{
// Check if this member is actually of a composite value type.
@@ -5904,9 +5903,19 @@ namespace relational
//
semantics::class_* comp (
context::composite_wrapper (context::utype (*m)));
+
if (comp == 0)
break;
+ // Handle "see-through" virtual data members.
+ //
+ if (!m->count ("virtual") || m->name ()[0] != '_')
+ {
+ r += (first ? "::" : ".");
+ r += ctx.public_name (*m);
+ first = false;
+ }
+
ptt = tt;
tt = l.next (tl, &tn);
@@ -5919,13 +5928,13 @@ namespace relational
m = &comp->lookup<data_member> (tl, scope::include_hidden);
- r += '.';
- r += ctx.public_name (*m);
-
if (check_ptr)
e.member_path.push_back (m);
}
+ r += (first ? "::" : ".");
+ r += ctx.public_name (*m);
+
// If requested, check if this member is a pointer. We only do this
// if there is nothing after this name.
//