aboutsummaryrefslogtreecommitdiff
path: root/odb/processor.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-12-12 10:20:12 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-12-12 10:20:12 +0200
commitf0a66d46cc013c301ed905c31fca50eefd67a874 (patch)
tree0aa66742b026a6f2e52bdb651e4d2daaf443a744 /odb/processor.cxx
parent9be991ba36305efdce2dac83eb0496fe1b9ff473 (diff)
Diagnose inverse maps
Diffstat (limited to 'odb/processor.cxx')
-rw-r--r--odb/processor.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/odb/processor.cxx b/odb/processor.cxx
index 89905c2..0964645 100644
--- a/odb/processor.cxx
+++ b/odb/processor.cxx
@@ -1825,6 +1825,15 @@ namespace
if (kt != 0)
process_container_value (*kt, m, "key", false);
+ // A map cannot be an inverse container.
+ //
+ if (m.count ("value-inverse") && (ck == ck_map || ck == ck_multimap))
+ {
+ os << m.file () << ":" << m.line () << ":" << m.column () << ":"
+ << " error: inverse container cannot be a map" << endl;
+ throw operation_failed ();
+ }
+
// If this is an inverse side of a bidirectional object relationship
// and it is an ordered container, mark it as unordred since there is
// no concept of order in this construct.