Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion regression/ansi-c/gcc_attributes6/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE gcc-only
CORE gcc-only test-c++-front-end
main.c

^EXIT=0$
Expand Down
9 changes: 2 additions & 7 deletions src/cpp/cpp_convert_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,15 +330,10 @@ void cpp_convert_plain_type(typet &type, message_handlert &message_handler)
type.id() == ID_union || type.id() == ID_array || type.id() == ID_code ||
type.id() == ID_unsignedbv || type.id() == ID_signedbv ||
type.id() == ID_bool || type.id() == ID_floatbv || type.id() == ID_empty ||
type.id() == ID_constructor || type.id() == ID_destructor)
type.id() == ID_constructor || type.id() == ID_destructor ||
type.id() == ID_c_enum)
{
}
else if(type.id()==ID_c_enum)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems unrelated to _Complex?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, see the last sentence of the commit message in the second commit. It's drive-by cleanup while debugging to eventually make it possible to successfully pass the regression test that the second commit enables. (That regression test ensures we have coverage of the changes in the first commit.)

{
// add width -- we use int, but the standard
// doesn't guarantee that
type.set(ID_width, config.ansi_c.int_width);
}
else if(type.id() == ID_c_bool)
{
type.set(ID_width, config.ansi_c.bool_width);
Expand Down
19 changes: 15 additions & 4 deletions src/cpp/cpp_typecheck_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Author: Daniel Kroening, kroening@cs.cmu.edu
/// \file
/// C++ Language Type Checking

#include "cpp_typecheck.h"

#include <util/source_location.h>
#include <util/simplify_expr.h>
#include <util/c_types.h>
#include <util/simplify_expr.h>
#include <util/source_location.h>

#include <ansi-c/c_qualifiers.h>
#include <ansi-c/merged_type.h>

#include "cpp_convert_type.h"
#include "cpp_typecheck.h"
#include "cpp_typecheck_fargs.h"

void cpp_typecheckt::typecheck_type(typet &type)
Expand Down Expand Up @@ -274,8 +274,19 @@ void cpp_typecheckt::typecheck_type(typet &type)
}
else if(type.id() == ID_gcc_attribute_mode)
{
PRECONDITION(type.has_subtype());
merged_typet as_parsed;
as_parsed.move_to_subtypes(type.subtype());
type.get_sub().clear();
as_parsed.move_to_subtypes(type);
type.swap(as_parsed);

c_typecheck_baset::typecheck_type(type);
}
else if(type.id() == ID_complex)
{
// already done
}
else
{
error().source_location=type.source_location();
Expand Down