Skip to content

Commit 44cb7c9

Browse files
committed
decltype(bit field type) is the underlying subtype
1 parent 5467da3 commit 44cb7c9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

regression/cpp/Bit_fields1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
main.cpp
33
-std=c++11
44
^EXIT=0$

src/cpp/cpp_typecheck_type.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@ void cpp_typecheckt::typecheck_type(typet &type)
238238
{
239239
exprt e=static_cast<const exprt &>(type.find(ID_expr_arg));
240240
typecheck_expr(e);
241-
type=e.type();
241+
242+
if(e.type().id() == ID_c_bit_field)
243+
type = e.type().subtype();
244+
else
245+
type = e.type();
242246
}
243247
else if(type.id()==ID_unassigned)
244248
{

0 commit comments

Comments
 (0)