HomePhabricator

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

Authored by mgehre on Apr 14 2020, 11:17 AM.

Description

[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