Skip to content

add an implementation of std::variant<...> #3962

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

Closed
wants to merge 1 commit into from

Conversation

kroening
Copy link
Member

@kroening kroening commented Jan 27, 2019

This appears to require update 3 of MSVC 2015, which may be an issue.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • 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).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@kroening
Copy link
Member Author

I don't usually like introducing dependencies, but this one will disappear by itself with time.

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

I'm not particularly convinced we need this, but should there genuinely be a use case we need tests (cf. unit/util/optional.cpp), and possibly documentation, though tests would also serve as such. As is, we have no idea whether this passes CI.

Copy link
Contributor

@LAJW LAJW left a comment

Choose a reason for hiding this comment

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

😱 👍 🥕 Let's make it happen!

@kroening kroening force-pushed the variant-submodule branch 4 times, most recently from 5d3a2c9 to 83f53a7 Compare January 29, 2019 15:27
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.

🚫
This PR failed Diffblue compatibility checks (cbmc commit: 83f53a7).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98995273
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

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: b10a24e).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/99566510

Copy link
Contributor

@thomasspriggs thomasspriggs left a comment

Choose a reason for hiding this comment

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

Looks really useful. I notice that the upstream repository for this includes tests. Maybe we should copy over the tests as well, so this can be tested on CI.

@thk123
Copy link
Contributor

thk123 commented Feb 27, 2019

I had a quick look at the upstream tests - they are written in GTest - I think rewriting them in catch would be time consuming and error prone. Instead - I suggest including this as a submodule so we can trust that the tests are run by the upstream CI. Alternatively, we could run the tests on our CI - but would involve adding a dependency on gtest for CI. (closed by mistake!)

@tautschnig for motivation - I think if this had existed when symbolt or goto_trace_stept had existed their design would be more robust. Can encode the different types of symbol (e.g. function symbols have a code_typet rather than a typet) but keep the value semantics, don't have awkward class hierarchies.

@thk123 thk123 closed this Feb 27, 2019
@thk123 thk123 reopened this Feb 27, 2019
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: ffca144).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/102486684

@kroening
Copy link
Member Author

kroening commented Mar 6, 2019

goto_trace_stept is certainly an obvious "customer"; should we use that as trial?

@thk123
Copy link
Contributor

thk123 commented Mar 7, 2019

@kroening in principle yes, I worried in practise that something that central would be a very large undertaking. I proposed it as a "motivating example" to demonstrated there are use cases on the assumption that other uses cases that are less entwined was also crop up.

@thk123 thk123 mentioned this pull request Mar 7, 2019
6 tasks
@thk123
Copy link
Contributor

thk123 commented Mar 7, 2019

Added as a submodule in #4344 if people would like to review that as well.

@TGWDB
Copy link
Contributor

TGWDB commented Sep 15, 2021

This PR appears like it could be useful if rebased, any chance of this being revisited (or should we consider closing as too old and out of date)?

This allows strengthening type safety in a number of data structures we
already have.
@codecov
Copy link

codecov bot commented Sep 15, 2021

Codecov Report

Merging #3962 (0208d01) into develop (ea82b03) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3962   +/-   ##
========================================
  Coverage    75.90%   75.90%           
========================================
  Files         1515     1515           
  Lines       163990   163989    -1     
========================================
+ Hits        124473   124474    +1     
+ Misses       39517    39515    -2     
Impacted Files Coverage Δ
src/goto-instrument/contracts/contracts.cpp 94.92% <100.00%> (-0.01%) ⬇️
src/goto-instrument/contracts/assigns.cpp 96.66% <0.00%> (+2.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7435884...0208d01. Read the comment docs.

@TGWDB
Copy link
Contributor

TGWDB commented Sep 15, 2021

@tautschnig This PR now passes all CI and is waiting only on your requested change, can you please have a look?

@TGWDB
Copy link
Contributor

TGWDB commented May 3, 2023

Closing due to age (no further comment on PR content), please reopen with rebase on develop if you intent to continue this work.

@TGWDB TGWDB closed this May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants