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

55 views Asked by At

[I've edited this question as I simplified the example causing the issue]

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

error: call to implicitly-deleted copy constructor of 'Foo'
                : foo{move(_foo)},
                  ^     [in a constructor member initialiser list]

note: copy constructor is implicitly deleted because 'Foo' has a user-declared move constructor
            Foo(Foo&&) = default;

move(_foo) is clearly an xvalue -- why is the copy constructor being called?

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.

1

There are 1 answers

0
Mohan On

I had the same issue with g++ 4.8, indicating it was a problem with the libraries. And indeed,

trusty [...] uses gcc-4 series standard library and is not C++11 conforming.

https://github.com/travis-ci/travis-ci/issues/6300#issue-165225842