[all-commits] [llvm/llvm-project] 1c9690: [clangd] Add test for GH75115

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Tue Dec 12 20:40:01 PST 2023


  Branch: refs/heads/users/mizvekov/bug/clangd-msvc-assert-crash-fix
  Home:   https://github.com/llvm/llvm-project
  Commit: 1c9690d87f3a3bbe8389cb9a852d00fe2d3cf478
      https://github.com/llvm/llvm-project/commit/1c9690d87f3a3bbe8389cb9a852d00fe2d3cf478
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2023-12-12 (Tue, 12 Dec 2023)

  Changed paths:
    A clang-tools-extra/clangd/test/GH75115.test

  Log Message:
  -----------
  [clangd] Add test for GH75115

Add test for https://github.com/llvm/llvm-project/issues/75115


  Commit: 4240125dc4b5b45a8ef8d226a94e39a35064c698
      https://github.com/llvm/llvm-project/commit/4240125dc4b5b45a8ef8d226a94e39a35064c698
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2023-12-13 (Wed, 13 Dec 2023)

  Changed paths:
    M clang-tools-extra/clangd/index/SymbolCollector.cpp
    M clang-tools-extra/clangd/test/GH75115.test

  Log Message:
  -----------
  [clangd] check for synthesized symbols when tracking include locations

This fixes https://github.com/llvm/llvm-project/issues/75115

In C mode with MSVC compatibility, when the `assert` macro is defined,
as a workaround, `static_assert` is implicitly defined as well,
if not already so, in order to work around a broken `assert.h`
implementation.
This workaround was implemented in https://github.com/llvm/llvm-project/commit/8da090381d567d0ec555840f6b2a651d2997e4b3

A synthesized symbol does not occur in source code, and therefore
should not have valid source location, but this was not checked when
inserting this into a `symbol -> include file` map.

The invalid FileID value is used for empty key representation in
the include file hash table, so it's not valid to insert it.


Compare: https://github.com/llvm/llvm-project/compare/51de797d836f...4240125dc4b5


More information about the All-commits mailing list