diff options
Diffstat (limited to 'gcc/cp/decl2.c')
| -rw-r--r-- | gcc/cp/decl2.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 42e9240..3b23638 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -946,6 +946,14 @@ grokbitfield (const cp_declarator *declarator, if (TREE_CODE (value) == VOID_TYPE) return void_type_node; + if (!INTEGRAL_TYPE_P (TREE_TYPE (value)) + && (POINTER_TYPE_P (value) + || !dependent_type_p (TREE_TYPE (value)))) + { + error ("bit-field %qD with non-integral type", value); + return error_mark_node; + } + if (TREE_CODE (value) == TYPE_DECL) { error ("cannot declare %qD to be a bit-field type", value); |
