justmao945 / vim-clang

Clang completion plugin for vim
ISC License
358 stars 47 forks source link

Issues with LLVM-3.9.0-win64.exe with vim_clang #105

Open Pinaki82 opened 8 years ago

Pinaki82 commented 8 years ago

Today I downloaded Clang 3.9.0 just to discover something new and no wonder I got a very strange issue with this clang version as I'm always used to get issues and find a fix with every new clang release.

==================================

C:\Users\xxxxuname>clang --version clang version 3.9.0 (branches/release_39) Target: x86_64-pc-windows-msvc Thread model: posix InstalledDir: C:\Program Files\LLVM\bin

==================================

This time, I got the following error when I tried autocompletion after

std::

This is the error:


In file included from L_1_1.cpp:2: In file included from C:\codeblocks\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\5.1.0\include\c++\iostream:39: In file included from C:\codeblocks\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\5.1.0\include\c++\ostream:38: In file included from C:\codeblocks\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\5.1.0\include\c++\ios:40: In file included from C:\codeblocks\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\5.1.0\include\c++\bits/char_traits.h:39: In file included from C:\codeblocks\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\5.1.0\include\c++\bits/stl_algobase.h:64: In file included from C:\codeblocks\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\5.1.0\include\c++\bits/stl_pair.h:59: In file included from C:\codeblocks\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\5.1.0\include\c++\bits/move.h:57: C:\codeblocks\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\5.1.0\include\c++\type_traits:311:39: error: float128 is not supported on this target struct is_floating_point_helper<__float128> ^


As before, I had to find a workaround to this, and now the fix is:

Create a file 'vim_clang_setup.vim' in "%USERPROFILE%\.vim\plugin" with the following lines:

===========================

let g:clang_dotfile = '$HOME/.vim_clang_includes' let g:clang_format_auto = 0 " Style can be LLVM, Google, Chromium, Mozilla, WebKit " let g:clang_format_style = 'LLVM' let g:clang_include_sysheaders = 1 let g:clang_include_sysheaders_from_gcc = 1 let g:clang_cpp_options = '-std=gnu++11' let g:clang_cpp_options = '-W' let g:clang_verbose_pmenu = 1

" ~~~~~~~~~~~~~~~~~~ " USING vim_clang WITH WXWIDGETS GUI LIBRARY " ~~~~~~~~~~~~~~~~~~ " 1) Enter Directory "C:\wxWidgets-3.0.2\include" " 2) Copy the 'wx' folder to " "C:\codeblocks\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\5.1.0\include" " 3) Now go to the directory " "C:\wxWidgets-3.0.2\lib\gcc_dll\mswu\wx" and copy 'setup.h' to " "C:\codeblocks\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\5.1.0\include\wx" " 4) put following line to VIMRC file for CPP filetypes detected by vim_clang. " let g:clang_cpp_options = '-std=gnu++11'

" ALL THE BEST. ALL THE ERRORS WILL BE GONE.

===========================

Notice that '-W' option. After adding let g:clang_cpp_options = '-W' option to the configuration file I successfully suppressed this type of warning. This is not an issue with vim-clang, this is just an issue with the new clang 3.9.0. I hope this information will help other MinGWw64 users those who are using vim-clang with the clang 3.9.0. Thanks.