aboutsummaryrefslogtreecommitdiff
path: root/odb/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-06-16 09:20:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-06-16 09:20:40 +0200
commitbc6e269d1221f27d239044b376cc2c6e36dd1428 (patch)
treea8808c5e0e644112a7c9388ab9ae0cfbc62eb6c9 /odb/context.cxx
parentf88e9b93fd99b89e30ef702273f8272a2c8866ce (diff)
Diagnose forward use of composite object ids
Diffstat (limited to 'odb/context.cxx')
-rw-r--r--odb/context.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/odb/context.cxx b/odb/context.cxx
index e6e50b8..726495f 100644
--- a/odb/context.cxx
+++ b/odb/context.cxx
@@ -1091,6 +1091,23 @@ class_file (semantics::class_& c)
return c.file ();
}
+location_t context::
+class_location (semantics::class_& c)
+{
+ if (c.count ("definition"))
+ {
+ return c.get<location_t> ("definition");
+ }
+ else if (c.is_a<semantics::class_instantiation> ())
+ {
+ return c.get<location_t> ("location");
+ }
+ else
+ {
+ return real_source_location (TYPE_NAME (c.tree_node ()));
+ }
+}
+
string context::
upcase (string const& s)
{