Skip to content

Constructor broken with gcc-4.8.5 #75

@rnburn

Description

@rnburn
#include <iostream>

#include "variant.hpp"

struct sv {
        sv(const char*) {}
};

int main() {
        mpark::variant<bool, sv> v{"abc"};
        std::cout << v.index() << "\n";
        return 0;
}

With gcc-4.8.5, this code incorrectly prints 0.

It works for later versions of gcc (tested 7.5.0) and prints 1.

I tested against master 3c7fc82

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions