aboutsummaryrefslogtreecommitdiff
path: root/odb/pragma.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-07-31 12:16:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-07-31 12:16:55 +0200
commit4fcb4ae749b3cf40f24ab1b9ddeb58b3ae0600f7 (patch)
tree6b6ad35e6895b7f1e8e81984fadc43ebfabd163e /odb/pragma.cxx
parent9c9b8f3a03951e1b7cc489ce0ec018a03520c039 (diff)
Add support for changing location that ODB views as class definition
This is useful for making third-party/system types into ODB composite value types. New pragma: definition. New test: common/definition.
Diffstat (limited to 'odb/pragma.cxx')
-rw-r--r--odb/pragma.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/odb/pragma.cxx b/odb/pragma.cxx
index abb6692..ffe711f 100644
--- a/odb/pragma.cxx
+++ b/odb/pragma.cxx
@@ -404,7 +404,8 @@ check_spec_decl_type (tree d,
p == "query" ||
p == "object" ||
p == "optimistic" ||
- p == "polymorphic")
+ p == "polymorphic" ||
+ p == "definition")
{
if (tc != RECORD_TYPE)
{
@@ -1162,6 +1163,19 @@ handle_pragma (cxx_lexer& l,
tt = l.next (tl, &tn);
}
+ else if (p == "definition")
+ {
+ // definition
+ //
+
+ // Make sure we've got the correct declaration type.
+ //
+ if (decl != 0 && !check_spec_decl_type (decl, decl_name, p, loc))
+ return;
+
+ val = l.location ();
+ tt = l.next (tl, &tn);
+ }
else if (p == "callback")
{
// callback (name)