aboutsummaryrefslogtreecommitdiff
path: root/odb/plugin.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-03-25 14:06:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-03-25 14:06:07 +0200
commitf34d324890f289bebbfee2358c6fd29f361f1b48 (patch)
tree1f1850cf059a843de4ddd0726faef14158f6226c /odb/plugin.cxx
parent01f77f6d38283b4efbe2b55fc9c7c837fd6498dc (diff)
Handle bit fields
Diffstat (limited to 'odb/plugin.cxx')
-rw-r--r--odb/plugin.cxx15
1 files changed, 14 insertions, 1 deletions
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));