HomePhabricator

[clang-tidy] modernize-use-using: Fix broken fixit with InjectedClassName

Authored by mgehre on Apr 12 2020, 11:06 AM.

Description

[clang-tidy] modernize-use-using: Fix broken fixit with InjectedClassName

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

template <int A>
struct InjectedClassName {
  typedef InjectedClassName b;
};

into using b = InjectedClassName<A>; and

template <int>
struct InjectedClassNameWithUnnamedArgument {
  typedef InjectedClassNameWithUnnamedArgument b;
};

into using b = InjectedClassNameWithUnnamedArgument<>;.
The first fixit is surprising because its different than the code
before, but the second fixit doesn't even compile.

This PR adds an option to the TypePrinter to print InjectedClassNameType without
template parameters (i.e. as written).

Reviewers: aaron.ballman, alexfh, hokein, njames93

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

Details