<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/90472>90472</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Documentation for NestedNameSpecifierLoc::hasQualifier says "is empty", should say "is non-empty"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          smcpeak
      </td>
    </tr>
</table>

<pre>
    The [documentation](https://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifierLoc.html#aca74c0c067c313944788259f89cf03e3) for `clang::NestedNameSpecifierLoc::hasQualifier` says:

> Evaluates true when this nested-name-specifier location is empty.

However, this is wrong, as it should say that it evaluates to true when the NNS is *not* empty, as the name suggests.  This can be seen by comparing its comment and implementation to that of `operator bool()` above it in `NestedNameSpecifier.h`:

```C++
  /// Evaluates true when this nested-name-specifier location is
  /// non-empty.
  explicit operator bool() const { return Qualifier; }
 
  /// Evaluates true when this nested-name-specifier location is
  /// empty.
  bool hasQualifier() const { return Qualifier; }
```

They both do the same thing, returning `true` iff the private data member `Qualifier` is not `nullptr`, so clearly one of the comments is wrong, and in this case it is the second one.

I see this issue in the latest version of Clang on the `main` branch on github at time of writing.

(For clarity, I'm filing the issue, but I do not currently intend to submit a fix.)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VV1v6zYM_TXKC9FAkR07fvBDP26wAkOB4fb9gpZpW5ssGZKcNv9-oN2mzV0fNgwXMBKYlA8PyUMKYzS9I6rF_k7sHzY4p8GHOo56Ivxr0_j2XD8PBGJ_13o9j-QSJuOd2D8IdRhSmqLIboU6CnXUFl2_tfY0bn3ohTq2_vXck1tdMS7-H7sfuyeKidonHOn7RNp0hsLvXm-HNFqhMtRY5lpqWZQ622VVnpeHg9pX3aHSncwoE6qCzgcQhVwgmUB2-zXo6hsw_jGjXYy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