[all-commits] [llvm/llvm-project] e0f2d4: [clangd] Fix the crash in getQualification

Kirill Bobyrev via All-commits all-commits at lists.llvm.org
Mon Aug 2 00:08:49 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e0f2d4af031c93b46f0920620ab6a798113b4b6e
      https://github.com/llvm/llvm-project/commit/e0f2d4af031c93b46f0920620ab6a798113b4b6e
  Author: Kirill Bobyrev <kbobyrev at google.com>
  Date:   2021-08-02 (Mon, 02 Aug 2021)

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

  Log Message:
  -----------
  [clangd] Fix the crash in getQualification

Happens when DestContext is LinkageSpecDecl and hense CurContext happens to be
both not TagDecl and NamespaceDecl.

Minimal reproducer: trigger define outline in

```
namespace ns {
extern "C" {
typedef int foo;
}
foo Fo^o(int id) { return id; }
}
```

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D107047




More information about the All-commits mailing list