Skip to content

Move class_typet::baset to struct_typet #3027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2018

Conversation

tautschnig
Copy link
Collaborator

Structs can have base classes/structs. This enables wide use of the bases() API.

  • Each commit message has a non-empty body, explaining why the change was made.
  • My contribution is formatted in line with CODING_STANDARD.md.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@kroening
Copy link
Member

Does it make sense to have a middle layer -- struct_with_base_typet or so?
Most users of stuct_typet do not need protection or inheritance.

@tautschnig
Copy link
Collaborator Author

Does it make sense to have a middle layer -- struct_with_base_typet or so?

Maybe - what is the cost of having this API in there, and thus the added value of struct_with_base_typet?

@tautschnig tautschnig force-pushed the bases branch 2 times, most recently from 245c7b5 to c6a55e7 Compare September 24, 2018 13:53
@smowton
Copy link
Contributor

smowton commented Sep 24, 2018

On the other hand does C++ really distinguish a class from a struct at all? I appreciate there are two keywords, but isn't a struct just a class with default public visibility, and the real distinction is between plain-old-data (C-ish structs) any anything else?

@tautschnig
Copy link
Collaborator Author

On the other hand does C++ really distinguish a class from a struct at all?

I'd say the only difference is, as you said, the default access. Which has been clarified in #3002 (cf07c6c).

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

Passed Diffblue compatibility checks (cbmc commit: c6a55e7).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85748394

if(member_type.get(ID_identifier)
==parent_it->find(ID_type).get(ID_identifier))
if(
member_type.get(ID_identifier) ==
Copy link
Member

Choose a reason for hiding this comment

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

get_identifier() if possible?

Structs can have base classes/structs. This enables wide use of the bases() API.
@tautschnig tautschnig merged commit ca235a9 into diffblue:develop Sep 25, 2018
@tautschnig tautschnig deleted the bases branch September 25, 2018 07:36
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

Passed Diffblue compatibility checks (cbmc commit: 1f5e03c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85823211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants