[all-commits] [llvm/llvm-project] 0642e5: [clang-tidy] modernize-use-using: Fix broken fixit...

Matthias Gehre via All-commits all-commits at lists.llvm.org
Fri Apr 17 01:37:53 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0642e5e7a7e54a11120262cfafea0193e3a75faf
      https://github.com/llvm/llvm-project/commit/0642e5e7a7e54a11120262cfafea0193e3a75faf
  Author: Matthias Gehre <gehre.matthias at gmail.com>
  Date:   2020-04-17 (Fri, 17 Apr 2020)

  Changed paths:
    M clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp
    M clang/lib/AST/NestedNameSpecifier.cpp
    M clang/lib/AST/TypePrinter.cpp
    M clang/test/CXX/expr/expr.prim/expr.prim.req/type-requirement.cpp

  Log Message:
  -----------
  [clang-tidy] modernize-use-using: Fix broken fixit with 'template' keyword

Summary:
Before this PR, `modernize-use-using` would transform the typedef in
```

template <typename a> class TemplateKeyword {
  typedef typename a::template f<> e;
  typedef typename a::template f<>::d e2;
};
```
into
```
template <typename a> class TemplateKeyword {
  using d = typename a::b<>;
  using d2 = typename a::template a::b<>::c;
};
```
The first one is missing the `template` keyword,
the second one has an extra `a::` scope. Both result
in compilation errors.

Reviewers: aaron.ballman, alexfh, hokein, njames93

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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




More information about the All-commits mailing list