aboutsummaryrefslogtreecommitdiff
path: root/odb/validator.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-07-22 14:49:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-07-22 17:57:00 +0200
commit81ea37904e4959414b53b225b4b5e56e1b561bdc (patch)
tree6ae70d4adb9c0c3ed57679873de8061d5b9c5b19 /odb/validator.cxx
parent246b1557bf84082cc72ec2cbe089262b21c8bc97 (diff)
Add pragma for setting type's or member's default value
New pragma: default. New test: default.
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.
//