[all-commits] [llvm/llvm-project] 702529: [clang] Fix returning the underlying VarDecl as to...

Haojian Wu via All-commits all-commits at lists.llvm.org
Mon Oct 12 02:06:28 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 702529d899c87e9268bb33d836dbc91b6bce0b16
      https://github.com/llvm/llvm-project/commit/702529d899c87e9268bb33d836dbc91b6bce0b16
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2020-10-12 (Mon, 12 Oct 2020)

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

  Log Message:
  -----------
  [clang] Fix returning the underlying VarDecl as top-level decl for VarTemplateDecl.

Given the following VarTemplateDecl AST,

```
VarTemplateDecl col:26 X
|-TemplateTypeParmDecl typename depth 0 index 0
`-VarDecl X 'bool' cinit
  `-CXXBoolLiteralExpr 'bool' true
```

previously, we returned the VarDecl as the top-level decl, which was not
correct, the top-level decl should be VarTemplateDecl.

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




More information about the All-commits mailing list