diff options
Diffstat (limited to 'clang-tools-extra')
-rw-r--r-- | clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp | 1 | ||||
-rw-r--r-- | clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp index f352374..f6dc5c0 100644 --- a/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp @@ -58,6 +58,7 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) { printPolicy.SuppressScope = true; printPolicy.ConstantArraySizeAsWritten = true; printPolicy.UseVoidForZeroParams = false; + printPolicy.PrintInjectedClassNameWithArguments = false; std::string Type = MatchedDecl->getUnderlyingType().getAsString(printPolicy); std::string Name = MatchedDecl->getNameAsString(); diff --git a/clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp b/clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp index 8d25dbb..b74e67a 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp @@ -289,3 +289,16 @@ typedef enum { ea2, eb2 } EnumT2_CheckTypedefImpactFromAnotherFile; // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' // CHECK-FIXES: using EnumT2_CheckTypedefImpactFromAnotherFile = enum { ea2, eb2 }; +template <int A> +struct InjectedClassName { + typedef InjectedClassName b; + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use 'using' instead of 'typedef' + // CHECK-FIXES: using b = InjectedClassName; +}; + +template <int> +struct InjectedClassNameWithUnnamedArgument { + typedef InjectedClassNameWithUnnamedArgument b; + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use 'using' instead of 'typedef' + // CHECK-FIXES: using b = InjectedClassNameWithUnnamedArgument; +}; |