[llvm-bugs] [Bug 24838] New: Incomplete completions if function's curly brace is missing

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 16 05:19:40 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24838

            Bug ID: 24838
           Summary: Incomplete completions if function's curly brace is
                    missing
           Product: clang
           Version: 3.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nikolai.kosjar at theqtcompany.com
                CC: klimek at google.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Also affected: clang 3.6.x
Origin: https://bugreports.qt.io/browse/QTCREATORBUG-15073

% cat -n case-globalfunctions.cpp 
     1    int myprecedingGlobal;
     2    int f() { my // COMPLETE HERE
     3    int mysucceedingGlobal;
% 

Completion for mysucceedingGlobal is not offered:

% clang-3.7 -cc1 -code-completion-at case-globalfunctions.cpp:2:13
case-globalfunctions.cpp | grep my
case-globalfunctions.cpp:2:11: error: use of undeclared identifier 'my'
int f() { my
          ^
1 error generated.
COMPLETION: myprecedingGlobal : [#int#]myprecedingGlobal
zsh: exit 1     clang-3.7 -cc1 -code-completion-at   | 
zsh: done       grep --color=auto my
%

Similar for incomplete member functions:

% cat -n case-memberfunctions.cpp 
     1    int myprecedingGlobal;
     2    
     3    struct C {
     4        int myprecedingMember;
     5        int f() { my // COMPLETE HERE
     6        int mysucceedingMember;
     7    };
     8    
     9    int mysucceedingGlobal;
% 

% clang-3.7 -cc1 -code-completion-at case-memberfunctions.cpp:5:17
case-memberfunctions.cpp | grep my
case-memberfunctions.cpp:9:23: error: expected '}'
int mysucceedingGlobal;
                      ^
case-memberfunctions.cpp:3:10: note: to match this '{'
struct C {
         ^
case-memberfunctions.cpp:5:15: error: use of undeclared identifier 'my'
    int f() { my
              ^
2 errors generated.
COMPLETION: myprecedingGlobal : [#int#]myprecedingGlobal
COMPLETION: myprecedingMember : [#int#]myprecedingMember
COMPLETION: mysucceedingGlobal : [#int#]mysucceedingGlobal
zsh: exit 1     clang-3.7 -cc1 -code-completion-at   | 
zsh: done       grep --color=auto my
 %

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150916/95b65bd9/attachment-0001.html>


More information about the llvm-bugs mailing list