summaryrefslogtreecommitdiff
path: root/odb/validator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/validator.cxx')
-rw-r--r--odb/validator.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/odb/validator.cxx b/odb/validator.cxx
index b07f5cd..790a991 100644
--- a/odb/validator.cxx
+++ b/odb/validator.cxx
@@ -287,6 +287,18 @@ namespace
{
c.set ("id-member", id);
+ // Complain if an id member has a default value (default value
+ // for the id's type is ok -- we will ignore it).
+ //
+ if (id->count ("default"))
+ {
+ cerr << id->file () << ":" << id->line () << ":" << id->column ()
+ << ": error: object id member cannot have default value"
+ << endl;
+
+ valid_ = false;
+ }
+
// Automatically mark the id member as not null. If we already have
// an explicit null pragma for this member, issue an error.
//