From bd7846e4f743f252191658e6589cc28d42c47cb4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 6 Aug 2014 11:52:15 +0200 Subject: Make sure persistent class templates are fully instantiated --- odb/pragma.cxx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/odb/pragma.cxx b/odb/pragma.cxx index 6a2d6ba..0dc61f2 100644 --- a/odb/pragma.cxx +++ b/odb/pragma.cxx @@ -3793,7 +3793,7 @@ register_odb_pragmas (void*, void*) void post_process_pragmas () { - // Make sure composite class template instantiations are fully + // Make sure object and composite class template instantiations are fully // instantiated. // for (decl_pragmas::iterator i (decl_pragmas_.begin ()), @@ -3807,18 +3807,30 @@ post_process_pragmas () if (!(CLASS_TYPE_P (type) && CLASSTYPE_TEMPLATE_INSTANTIATION (type))) continue; - // Check whether this is a composite value type. We don't want to - // instantiate simple values since they may be incomplete. + // Check whether this is an object or composite value type. // pragma const* p (0); + string diag_name; for (pragma_set::iterator j (i->second.begin ()), e (i->second.end ()); j != e; ++j) { string const& name (j->context_name); - if (name == "value") + if (name == "object") + { + p = &*j; + diag_name = "persistent object"; + break; + } + else if (name == "value") + { p = &*j; + diag_name = "composite value"; + } + // We don't want to instantiate simple values since they may be + // incomplete. + // else if (name == "simple" || name == "container") { p = 0; @@ -3843,9 +3855,8 @@ post_process_pragmas () errorcount != 0 || !COMPLETE_TYPE_P (type)) { - error (loc) << "unable to instantiate composite value class template" + error (loc) << "unable to instantiate " << diag_name << " class template" << endl; - throw pragmas_failed (); } } -- cgit v1.1