aboutsummaryrefslogtreecommitdiff
path: root/odb/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-01-23 14:17:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-01-23 14:17:22 +0200
commitfc03b894489f39c81f69cd789fd9a08aa5acf91b (patch)
tree764bd50403ceb177f144a93a664f123fd41b5b72 /odb/context.cxx
parentd864e71f0f79ba31bb330b2493f7aaf80ae4d0f5 (diff)
Fix ability to handle C-style arrays as containers
Diffstat (limited to 'odb/context.cxx')
-rw-r--r--odb/context.cxx8
1 files changed, 5 insertions, 3 deletions
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<array*> (&utype (t)))
+ array* a;
+ if (decay && (a = dynamic_cast<array*> (&utype (t))) != 0)
{
semantics::type& bt (a->base_type ());
hint = a->contains ().hint ();