[llvm-bugs] [Bug 28369] New: Member completion of forward declared class emits non-member completion results

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 30 01:57:19 PDT 2016


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

            Bug ID: 28369
           Summary: Member completion of forward declared class emits
                    non-member completion results
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nikolai.kosjar at qt.io
                CC: klimek at google.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

~/work/clang-research/completeFwd % cat -n typeForwardDeclared.cpp
     1  class Foo;
     2  void g(Foo &foo)
     3  {
     4      foo. // Complete here
     5  }
     6

Complete at that point will emit non-member completion results, as if there is
no "foo." in that line:

~/work/clang-research/completeFwd %
/home/nik/usr/llvm-trunk_install/bin/clang-3.9 -cc1 -code-completion-at
typeForwardDeclared.cpp:4:9 typeForwardDeclared.cpp
typeForwardDeclared.cpp:4:8: error: member access into incomplete type 'Foo'
    foo.<U+0000> // Complete here
       ^
typeForwardDeclared.cpp:1:7: note: forward declaration of 'Foo'
class Foo;
      ^
COMPLETION: __FUNCTION__
COMPLETION: __PRETTY_FUNCTION__
COMPLETION: _Nonnull
COMPLETION: _Null_unspecified
COMPLETION: _Nullable
COMPLETION: bool
COMPLETION: char
COMPLETION: class
COMPLETION: const
COMPLETION: Pattern : const_cast<<#type#>>(<#expression#>)
COMPLETION: Pattern : [#void#]delete <#expression#>
COMPLETION: Pattern : [#void#]delete [] <#expression#>
COMPLETION: double
COMPLETION: Pattern : dynamic_cast<<#type#>>(<#expression#>)
COMPLETION: enum
COMPLETION: extern
COMPLETION: Pattern : [#bool#]false
COMPLETION: float
COMPLETION: Foo : Foo
COMPLETION: foo : [#Foo &#]foo
COMPLETION: g : [#void#]g(<#Foo &foo#>)
COMPLETION: Pattern : goto <#label#>
COMPLETION: int
COMPLETION: long
COMPLETION: Pattern : new <#type#>(<#expressions#>)
COMPLETION: Pattern : new <#type#>[<#size#>](<#expressions#>)
COMPLETION: operator
COMPLETION: Pattern : reinterpret_cast<<#type#>>(<#expression#>)
COMPLETION: Pattern : return
COMPLETION: short
COMPLETION: signed
COMPLETION: Pattern : [#size_t#]sizeof(<#expression-or-type#>)
COMPLETION: static
COMPLETION: Pattern : static_cast<<#type#>>(<#expression#>)
COMPLETION: struct
COMPLETION: Pattern : [#bool#]true
COMPLETION: Pattern : typedef <#type#> <#name#>
COMPLETION: Pattern : [#std::type_info#]typeid(<#expression-or-type#>)
COMPLETION: Pattern : typename <#qualifier#>::<#name#>
COMPLETION: Pattern : typeof <#expression#>
COMPLETION: Pattern : typeof(<#type#>)
COMPLETION: union
COMPLETION: unsigned
COMPLETION: Pattern : using namespace <#identifier#>
COMPLETION: void
COMPLETION: volatile
COMPLETION: wchar_t
1 error generated.



Expected is that it should not emit any results, as it does if the forward
declaration is commented out.

Happens also on the 3.8 branch.

-- 
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/20160630/1702012a/attachment.html>


More information about the llvm-bugs mailing list