From bc6e269d1221f27d239044b376cc2c6e36dd1428 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 16 Jun 2015 09:20:40 +0200 Subject: Diagnose forward use of composite object ids --- odb/context.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'odb/context.cxx') 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 ("definition"); + } + else if (c.is_a ()) + { + return c.get ("location"); + } + else + { + return real_source_location (TYPE_NAME (c.tree_node ())); + } +} + string context:: upcase (string const& s) { -- cgit v1.1