Skip to content

c5ac035 breaks build on clang-3.4 #791

@klmr

Description

@klmr

Running ./install.py on macOS 10.10.5 with clang-3.4 (clang 3.4.2 fails with the following error message:

FAILED: /usr/local/bin/clang++-3.4 -stdlib=libc++ -DUSE_CLANG_COMPLETER -DYCMD_CORE_VERSION=28 -Dycm_core_EXPORTS -I/Users/rudolph/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm -I/Users/rudolph/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/ClangCompleter -isystem /Users/rudolph/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts -isystem /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/include/python2.7 -isystem ycm/../clang+llvm-4.0.0-x86_64-apple-darwin/include -nostdinc++ -isystem /usr/local/lib/llvm-3.4/include/c++/v1 -stdlib=libc++ -fcolor-diagnostics -O3 -DNDEBUG -fPIC -std=c++11 -MD -MT ycm/CMakeFiles/ycm_core.dir/IdentifierUtils.cpp.o -MF ycm/CMakeFiles/ycm_core.dir/IdentifierUtils.cpp.o.d -o ycm/CMakeFiles/ycm_core.dir/IdentifierUtils.cpp.o -c /Users/rudolph/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/IdentifierUtils.cpp

/Users/rudolph/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/IdentifierUtils.cpp:120:12: error: chosen constructor is explicit in copy-initialization
return {};

As far as I can see, this is an actual bug, introduced in c5ac035: the std::map copy constructor in C++11 is explicit, initialisation by {} in a return statement is thus forbidden (though g++ erroneously accepts the code).

A simple fix would be to replace the line with

return FiletypeIdentifierMap{};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions