From f34d324890f289bebbfee2358c6fd29f361f1b48 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 25 Mar 2010 14:06:07 +0200 Subject: Handle bit fields --- odb/plugin.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'odb/plugin.cxx') diff --git a/odb/plugin.cxx b/odb/plugin.cxx index bb50a3f..4148f80 100644 --- a/odb/plugin.cxx +++ b/odb/plugin.cxx @@ -754,7 +754,20 @@ private: } case FIELD_DECL: { - tree t (TREE_TYPE (d)); + // If this is a bit-field then TREE_TYPE may be a modified type + // with lesser precision. In this case, DECL_BIT_FIELD_TYPE + // will be the type that was original specified. Use that type + // for now. Furthermore, bitfields can be anonymous, which we + // ignore. + // + // + bool bf (DECL_C_BIT_FIELD (d)); + + if (bf && DECL_NAME (d) == 0) + break; + + tree t (bf ? DECL_BIT_FIELD_TYPE (d) : TREE_TYPE (d)); + char const* name (IDENTIFIER_POINTER (DECL_NAME (d))); path file (DECL_SOURCE_FILE (d)); -- cgit v1.1