[all-commits] [llvm/llvm-project] 6d15a2: [clangd] Fix ParsedASTTest.TopLevelDecls test.
Ilya Golovenko via All-commits
all-commits at lists.llvm.org
Sun Nov 1 23:37:37 PST 2020
Author: Ilya Golovenko <ilya.golovenko at huawei.com>
Date: 2020-11-02 (Mon, 02 Nov 2020)
[clangd] Fix ParsedASTTest.TopLevelDecls test.
Google test matcher `DeclKind` uses `NamedDecl::getDeclKindName()` to compare its result with expected declaration name.
Both, returned value of this function and the expected kind name argument have type `const char *`, so this matcher effectively
compares two pointers instead of the respective strings.
The test was passing on most platforms because compilers mostly were able to coalesce these string literals.
Patch By: Ilya Golovenko
Reviewed By: hokein
Differential Revision: https://reviews.llvm.org/D90384
More information about the All-commits