llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.41k stars 12.15k forks source link

Clang completer doesn't work for header files with templates #17382

Open llvmbot opened 11 years ago

llvmbot commented 11 years ago
Bugzilla Link 17008
Version 3.3
OS MacOS X
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

I have tested the following header file:

template <class T>
class node
{
    private:

        node *next;
        T key;

    public:
        // constructors
        node()
        {
        this->
        }
        node(T key, node *next);

};

this-> will not complete using YouCompleteMe, a vim-script utilizing clang's autocompletion tools. If you delete the "template line, it will complete with ycm. More details can be found on the YouCompleteMe github page and conversations I've had with the developer.

I believe the issues above to be caused by how clang parses templates. My compiler flags are clang++ -I/usr/lib/c++/v1 -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 -std=c++11 -stdlib=libc++.

llvmbot commented 1 year ago

@llvm/issue-subscribers-clang-frontend

Author: None (llvmbot)

| | | | --- | --- | | Bugzilla Link | [17008](https://llvm.org/bz17008) | | Version | 3.3 | | OS | MacOS X | | Reporter | LLVM Bugzilla Contributor | | CC | @DougGregor | ## Extended Description I have tested the following header file: template <class T> class node { private: node *next; T key; public: // constructors node() { this-> } node(T key, node *next); }; this-> will not complete using YouCompleteMe, a vim-script utilizing clang's autocompletion tools. If you delete the "template <class T> line, it will complete with ycm. More details can be found on the YouCompleteMe github page and conversations I've had with the developer. I believe the issues above to be caused by how clang parses templates. My compiler flags are clang++ -I/usr/lib/c++/v1 -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 -std=c++11 -stdlib=libc++.