Opened 11 years ago

Closed 6 years ago

#5875 closed Bugs (fixed)

local variable in phoenix let discards value

Reported by: Lars Viklund <zao@…> Owned by: Thomas Heller
Milestone: To Be Determined Component: phoenix
Version: Boost Development Trunk Severity: Problem
Keywords: phoenix local let Cc:

Description

In the following test case, the size of the vector is zero, while it should be three as that's what the vector is constructed with.

#include <boost/phoenix.hpp>
#include <iostream>
#include <vector>

namespace phx = boost::phoenix;

int main()
{
        std::vector<int> v = phx::let(phx::local_names::_a = std::vector<int>(3))
        [
                phx::local_names::_a
        ]
        ();
        std::cerr << v.size() << std::endl;
}

If the local is used in a non-trivial way in the let block, the vector will be properly initialized.

Change History (4)

comment:1 by John Fletcher <J.P.Fletcher@…>, 9 years ago

This bug is now fixed by other changes. Test bug5875 installed as a check.

comment:2 by John Fletcher <J.P.Fletcher@…>, 9 years ago

The test bug5875 is failing with crashes on a number of compilers, but not any which I have available. I would be grateful for any information on this. In the meantime I will leave it on develop to get more information but will not post the test to master.

I have not made any changes to phoenix for this at all.

comment:3 by John Fletcher <J.P.Fletcher@…>, 9 years ago

I have withdrawn test bug5875 from develop for more testing offline.

comment:4 by Kohei Takahashi, 6 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.