[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

  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6d15a28a853d5eb453d58324141c9ec75d55c2da
  Author: Ilya Golovenko <ilya.golovenko at huawei.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M clang-tools-extra/clangd/unittests/ParsedASTTests.cpp

  Log Message:
  [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 mailing list