mardi 29 août 2017

Travis CI: clang deduces copy constructor when it should deduce move constructor

I'm getting the following error on Travis CI (dist: trusty) with clang 3.9:

error: call to deleted constructor of 'Foo<Bar>'
        return Foo<Bar>{Bar{}};

note: 'Foo' has been explicitly marked deleted here
        Foo(const Foo<Bar>&) = delete;  

However, the class

    template<typename B>{
    class Foo
        [...]
        Foo(const Foo<B>&) = delete;    
        Foo(Foo<B>&&) = default;            
    };

declares a move constructor, which should be called as Bar{} is a temporary. What's particularly odd is that compiling with clang 3.9 works on my local machine. I am setting -std=c++11. I'd be grateful for any suggestions.

Aucun commentaire:

Enregistrer un commentaire