ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.43k stars 2.8k forks source link

completion regression after bump to clang version 3.7.0 #2185

Closed elPistolero closed 8 years ago

elPistolero commented 8 years ago

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

Thank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.

Issue Details

I use YCM with a large c++ codebase. More specifically I'm programming plugins for a geometry processing framework, which link against a mesh library called OpenMesh.

General completion (QT, std library, etc.) works fine. However, completion with OpenMesh, which makes heavy use of template programming does not work with the current version of YCM.

Via git bisect I have found the first 'bad' commit to be a7bb97f100fe9780850226250c341e1dda838a9e. Bisecting ycmd I have verified that the first 'bad' commit there is https://github.com/Valloric/ycmd/commit/9b9766b86a2df484fade961600615ff7e4032dea. Completion with clang 3.6.2 works wonderful.

I'm not entirely sure how I can produce a minimal example, because I don't know why completion fails exactly.

Is there anything I can do to debug this issue?

OS version: Debian 8.4 (kernel: 3.16.0-4-amd64)

vim --version output: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 7 2014 10:17:05) Included patches: 1-464

Huge version with GTK2 GUI. Features included (+) or not (-): +acl +farsi +mouse_netterm +syntax +arabic +file_in_path +mouse_sgr +tag_binary +autocmd +find_in_path -mouse_sysmouse +tag_old_static +balloon_eval +float +mouse_urxvt -tag_any_white +browse +folding +mouse_xterm -tcl ++builtin_terms -footer +multi_byte +terminfo +byte_offset +fork() +multi_lang +termresponse +cindent +gettext -mzscheme +textobjects +clientserver -hangul_input +netbeans_intg +title +clipboard +iconv +path_extra +toolbar +cmdline_compl +insert_expand -perl +user_commands +cmdline_hist +jumplist +persistent_undo +vertsplit +cmdline_info +keymap +postscript +virtualedit +comments +langmap +printer +visual +conceal +libcall +profile +visualextra +cryptv +linebreak +python +viminfo +cscope +lispindent -python3 +vreplace +cursorbind +listcmds +quickfix +wildignore +cursorshape +localmap +reltime +wildmenu +dialog_con_gui +lua +rightleft +windows +diff +menu -ruby +writebackup +digraphs +mksession +scrollbind +X11 +dnd +modify_fname +signs -xfontset -ebcdic +mouse +smartindent +xim +emacs_tags +mouseshape -sniff +xsmp_interact +eval +mouse_dec +startuptime +xterm_clipboard +ex_extra -mouse_gpm +statusline -xterm_save +extra_search -mouse_jsbterm -sun_workshop +xpm system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" system gvimrc file: "$VIM/gvimrc" user gvimrc file: "$HOME/.gvimrc" 2nd user gvimrc file: "~/.vim/gvimrc" system menu file: "$VIMRUNTIME/menu.vim"

Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -ldl -L/usr/lib -llua5.1 -L/usr/lib/python2.7/config -lpython2.7

vheon commented 8 years ago

This seems like a libclang bug more than a YCM one.

ping @r4nt @d0k

puremourning commented 8 years ago

Is his related to the 'incomplete' flag that we use? We know that turns off a bunch of the template stuff in clang for a 10x speed up. Though that was in place before 3.7.0.

On 25 May 2016, at 09:27, Andrea Cedraro notifications@github.com wrote:

This seems like a libclang bug more than a YCM one.

ping @r4nt @d0k

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

r4nt commented 8 years ago

To minimize, you could use creduce together with c-index-test from clang upstream, but I understand that's a lot to ask. Without some reproduction it'll be really hard to debug.

elPistolero commented 8 years ago

I'll try to construct a minimal example. Are there any guides on what the best way to debug this would be?

puremourning commented 8 years ago

Running c-index-test is pretty easy (though i think you need to build llvm/clang from source to get it).

If you can produce a reproducible (minimal) test case, then we can run it. However, until then there really isn't anything we can really do to help, so i'm closing this for now. We can re-open if you can get a test case together.