Issue |
90472
|
Summary |
Documentation for NestedNameSpecifierLoc::hasQualifier says "is empty", should say "is non-empty"
|
Labels |
new issue
|
Assignees |
|
Reporter |
smcpeak
|
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.)
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs