Skip to content

Commit 0872568

Browse files
committed
C++ front-end: bool is also an integral type
Visual Studio uses enums with a bool subtype in header files.
1 parent 396794c commit 0872568

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

buildspec-windows.yml

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ phases:
4747
Remove-Item cbmc\byte_update5 -Force -Recurse
4848
Remove-Item cbmc\byte_update6 -Force -Recurse
4949
Remove-Item cbmc\byte_update7 -Force -Recurse
50-
Remove-Item cpp\virtual1 -Force -Recurse
5150
Remove-Item goto-gcc -Force -Recurse
5251
cd ..
5352
cd jbmc/regression

src/cpp/cpp_typecheck_enum_type.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,10 @@ void cpp_typecheckt::typecheck_enum_type(typet &type)
155155
else
156156
{
157157
typecheck_type(type.subtype());
158-
if(type.subtype().id()==ID_signedbv ||
159-
type.subtype().id()==ID_unsignedbv)
160-
{
161-
}
162-
else
158+
if(
159+
type.subtype().id() != ID_signedbv &&
160+
type.subtype().id() != ID_unsignedbv &&
161+
type.subtype().id() != ID_c_bool)
163162
{
164163
error().source_location=type.source_location();
165164
error() << "underlying type must be integral" << eom;

0 commit comments

Comments
 (0)