summaryrefslogtreecommitdiff
path: root/odb
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-04-22 15:43:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-04-22 15:43:44 +0200
commitaf08f6c451f2f49bc474b04455d351ac226b102f (patch)
tree719ad908fb8e7de147799c34e8401d577d75ddc1 /odb
parent56deeaabaa8d818de008a02f3e7b8ee9e725e8a0 (diff)
Detect and diagnose incomplete pointed-to classes
Diffstat (limited to 'odb')
-rw-r--r--odb/relational/type-processor.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/odb/relational/type-processor.cxx b/odb/relational/type-processor.cxx
index 379c4aa..97f4d85 100644
--- a/odb/relational/type-processor.cxx
+++ b/odb/relational/type-processor.cxx
@@ -639,6 +639,24 @@ namespace relational
}
}
+ // Make sure the pointed-to class is complete.
+ //
+ if (!COMPLETE_TYPE_P (c->tree_node ()))
+ {
+ os << m.file () << ":" << m.line () << ":" << m.column () << ": "
+ << "error: pointed-to class '" << c->fq_name () << "' "
+ << "is incomplete" << endl;
+
+ os << c->file () << ":" << c->line () << ":" << c->column () << ": "
+ << "info: class '" << c->name () << "' is declared here" << endl;
+
+ os << c->file () << ":" << c->line () << ":" << c->column () << ": "
+ << "info: consider including its definition with the "
+ << "--odb-prologue option" << endl;
+
+ throw generation_failed ();
+ }
+
if (m.count ("not-null") && !kp.empty ())
{
m.remove ("not-null");