<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Completions without non-const member functions for const object"
   href="https://bugs.llvm.org/show_bug.cgi?id=33382">33382</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Completions without non-const member functions for const object
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>libclang
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nikolai.kosjar@qt.io
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>klimek@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Consider this:

$ cat -n $FILE                                        
     1  struct Foo {
     2  public:
     3      int public_field;
     4      void public_function();
     5  
     6  private:
     7      int private_field;
     8      void private_function();
     9  };
    10  
    11  void g(Foo &foo)
    12  {
    13      foo. // Complete
    14  }
$ ./c-index-test -code-completion-at=$FILE:13:9 $FILE 
StructDecl:{TypedText Foo}{Text ::} (75)
CXXMethod:{ResultType Foo &}{TypedText operator=}{LeftParen (}{Placeholder
const Foo &}{RightParen )} (34)
FieldDecl:{ResultType int}{TypedText private_field} (35) (inaccessible)
CXXMethod:{ResultType void}{TypedText private_function}{LeftParen (}{RightParen
)} (34) (inaccessible)
FieldDecl:{ResultType int}{TypedText public_field} (35)
CXXMethod:{ResultType void}{TypedText public_function}{LeftParen (}{RightParen
)} (34)
CXXDestructor:{ResultType void}{TypedText ~Foo}{LeftParen (}{RightParen )} (34)
Completion contexts:
Dot member access
Container Kind: StructDecl
Container is complete
Container USR: c:@S@Foo
$

This yields items for the private field and private function and denotes them
as inacessible, which is fine.

Now declare "foo" as const& and try again:

$ ./c-index-test -code-completion-at=$FILE:13:9 $FILE 
StructDecl:{TypedText Foo}{Text ::} (75)
FieldDecl:{ResultType int}{TypedText private_field} (35) (inaccessible)
FieldDecl:{ResultType int}{TypedText public_field} (35)
Completion contexts:
Dot member access
Container Kind: StructDecl
Container is complete
Container USR: c:@S@Foo
$

Ops, no items for the member functions at all. I would have expected items for
both functions, both marked as inaccessible/notAvailable.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>