<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - Namespace affects completion priority of enum types/values"
   href="https://llvm.org/bugs/show_bug.cgi?id=28734">28734</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Namespace affects completion priority of enum types/values
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.8
          </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>normal
          </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>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat -n c2.cpp
     1  enum EnumTypeA { EnumAValue1 };
     2  enum EnumTypeB { EnumBValue1 };
     3
     4  void foo(EnumTypeA et);
     5
     6  void c2()
     7  {
     8      foo( // Complete here
     9  }
    10

$ /usr/lib/llvm-3.8/bin/c-index-test -code-completion-at=c2.cpp:8:9 c2.cpp |
grep Enum
 EnumConstantDecl:{ResultType EnumTypeA}{TypedText EnumAValue1} (16)
 EnumConstantDecl:{ResultType EnumTypeB}{TypedText EnumBValue1} (65)
 EnumDecl:{TypedText EnumTypeA} (12)
 EnumDecl:{TypedText EnumTypeB} (50)
 FunctionDecl:{ResultType void}{TypedText foo}{LeftParen (}{Placeholder
EnumTypeA et}{RightParen )} (50)
 OverloadCandidate:{ResultType void}{Text foo}{LeftParen (}{CurrentParameter
EnumTypeA et}{RightParen )} (1)
 Enum tag

==> Looks fine, EnumTypeA/EnumAValue1 has higher priority (12 and 16) than
EnumTypeB/EnumBValue1 (50 and 65)

Now the same with a name space:

$ cat -n c3.cpp
     1  namespace N {
     2      enum EnumTypeA { EnumAValue1 };
     3      enum EnumTypeB { EnumBValue1 };
     4  }
     5
     6  void foo(N::EnumTypeA);
     7
     8  void c3()
     9  {
    10      foo(N:: // Complete here
    11  }

$ /usr/lib/llvm-3.8/bin/c-index-test -code-completion-at=c3.cpp:10:12 c3.cpp |
grep Enum
 EnumConstantDecl:{ResultType N::EnumTypeA}{TypedText EnumAValue1} (65)
 EnumConstantDecl:{ResultType N::EnumTypeB}{TypedText EnumBValue1} (65)
 EnumDecl:{TypedText EnumTypeA} (50)
 EnumDecl:{TypedText EnumTypeB} (50)

==> Ops, EnumTypeA and EnumTypeB have same priority, as EnumAValue1 and
EnumBValue1
==> The priorities should be like for the example above.</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>