From b34b6ffa9d4aae16272cbdbf508134f98b4647d4 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Thu, 22 Nov 2018 16:10:18 +0000 Subject: [clang-tidy] Ignore template instantiations in modernize-use-using The test I'm adding passes without the change due to the deduplication logic in ClangTidyDiagnosticConsumer::take(). However this bug manifests in our internal integration with clang-tidy. I've verified the fix by locally changing LessClangTidyError to consider replacements. llvm-svn: 347470 --- .../test/clang-tidy/modernize-use-using.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'clang-tools-extra/test/clang-tidy/modernize-use-using.cpp') diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-using.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-using.cpp index e8f4958f951..efa4030d001 100644 --- a/clang-tools-extra/test/clang-tidy/modernize-use-using.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-use-using.cpp @@ -162,3 +162,24 @@ typedef unsigned Map[lol]; typedef void (*fun_type)(); // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' // CHECK-FIXES: using fun_type = void (*)(); + +namespace template_instantiations { +template +class C { + protected: + typedef C super; + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use 'using' instead of 'typedef' + // CHECK-FIXES: using super = C; + virtual void f(); + +public: + virtual ~C(); +}; + +class D : public C { + void f() override { super::f(); } +}; +class E : public C { + void f() override { super::f(); } +}; +} -- cgit v1.2.3