[PATCH] D101870: [clangd] Check if macro is already in the IdentifierTable before loading it

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 5 02:07:34 PDT 2021


kadircet added a comment.

oh wow thanks! would you mind adding a test case like:

  TEST(CompletionTest, NoCrashDueToMacroOrdering) {
    EXPECT_THAT(completions(R"cpp(
      #define ECHO(X) X
      #define ECHO2(X) ECHO(X)
      int finish_preamble = E^CHO(2);)cpp")
                    .Completions,
                UnorderedElementsAre(Labeled("ECHO"), Labeled("ECHO2")));
  }

into clang-tools-extra/clangd/unittest/CodeCompleteTests.cpp ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101870/new/

https://reviews.llvm.org/D101870



More information about the cfe-commits mailing list