Skip to content

Commit

Permalink
Merge pull request diffblue#2344 from tautschnig/c++-vs-enum
Browse files Browse the repository at this point in the history
Support Visual Studio's forward enum declarations
  • Loading branch information
tautschnig authored Jun 12, 2018
2 parents 5b8897e + e0d56da commit f3a3e79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion regression/cpp/enum7/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KNOWNBUG
CORE
main.cpp

^EXIT=0$
Expand Down
10 changes: 7 additions & 3 deletions src/cpp/cpp_typecheck_enum_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ Author: Daniel Kroening, [email protected]
#include "cpp_typecheck.h"

#include <util/arith_tools.h>
#include <util/c_types.h>
#include <util/config.h>

#include <ansi-c/c_qualifiers.h>
#include <util/c_types.h>

#include "cpp_enum_type.h"

Expand Down Expand Up @@ -140,7 +141,9 @@ void cpp_typecheckt::typecheck_enum_type(typet &type)
throw 0;
}
}
else if(has_body)
else if(
has_body ||
config.ansi_c.mode == configt::ansi_ct::flavourt::VISUAL_STUDIO)
{
std::string pretty_name=
cpp_scopes.current_scope().prefix+id2string(base_name);
Expand Down Expand Up @@ -200,7 +203,8 @@ void cpp_typecheckt::typecheck_enum_type(typet &type)
if(new_symbol->type.get_bool(ID_C_class))
cpp_scopes.go_to(scope_identifier);

typecheck_enum_body(*new_symbol);
if(has_body)
typecheck_enum_body(*new_symbol);
}
else
{
Expand Down

0 comments on commit f3a3e79

Please sign in to comment.