From fc03b894489f39c81f69cd789fd9a08aa5acf91b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 23 Jan 2020 14:17:22 +0200 Subject: Fix ability to handle C-style arrays as containers --- odb/context.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'odb/context.cxx') diff --git a/odb/context.cxx b/odb/context.cxx index 4daa896..1e5c6c2 100644 --- a/odb/context.cxx +++ b/odb/context.cxx @@ -1493,15 +1493,17 @@ string context:: type_ref_type (semantics::type& t, semantics::names* hint, bool mc, - string const& var) + string const& var, + bool decay) { using semantics::array; string r; // Note that trailing const syntax is used for a reason (consider - // t == const foo*). We also have to decay top-level arrays. + // t == const foo*). We may also have to decay then top-level array. // - if (array* a = dynamic_cast (&utype (t))) + array* a; + if (decay && (a = dynamic_cast (&utype (t))) != 0) { semantics::type& bt (a->base_type ()); hint = a->contains ().hint (); -- cgit v1.1