Skip to content
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

Support moving from rvalues in std::initializer_list #663

Merged
merged 8 commits into from
Jul 30, 2017

Commits on Jul 23, 2017

  1. Configuration menu
    Copy the full SHA
    7b3cbff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cf3ca3b View commit details
    Browse the repository at this point in the history
  3. Support moving from rvalues in an std::initializer_list

    This commit works around an issue in std::initializer_list design.
    By using a detail::json_ref proxy with a mutable value inside,
    rvalue-ness of an input to list initializer is remembered and
    used later to move from the proxy instead of copying.
    himikof committed Jul 23, 2017
    Configuration menu
    Copy the full SHA
    09cda57 View commit details
    Browse the repository at this point in the history
  4. Update tests while fixing possible UB

    std::initializer_list does not own the temporaries created in
    its initialization. Therefore, storing it in an independent
    stack variable is unsafe.
    himikof committed Jul 23, 2017
    Configuration menu
    Copy the full SHA
    f5cae64 View commit details
    Browse the repository at this point in the history
  5. Fix an actually invalid test

    C++ overload resolution/list initialization rules are hard.
    himikof committed Jul 23, 2017
    Configuration menu
    Copy the full SHA
    0f4978e View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2017

  1. Configuration menu
    Copy the full SHA
    897879b View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2017

  1. Move from rvalues eagerly to work around MSVC problem

    On MSVC compiler, temporaries that are constructed during a
    list initialization, are sometimes destroyed even before calling
    the initializing constructor, instead of at the end of the
    containing full-expression. This is clearly non-conforming to
    [class.temporary].
    As the impact of this bug is silently producing incorrect
    JSON values, move eagerly from rvalues to be safe.
    
    See https://stackoverflow.com/questions/24586411
    himikof committed Jul 25, 2017
    Configuration menu
    Copy the full SHA
    93bb712 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2017

  1. Configuration menu
    Copy the full SHA
    aad5521 View commit details
    Browse the repository at this point in the history