summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2018-11-22 16:10:18 +0000
committerAlexander Kornienko <alexfh@google.com>2018-11-22 16:10:18 +0000
commitb34b6ffa9d4aae16272cbdbf508134f98b4647d4 (patch)
tree86a9d6ce615ed490c0ab8320e0a7ba477ea4422c /clang-tools-extra/test
parent840f03263072db90a20f636ab286b21523331ec6 (diff)
downloadbcm5719-llvm-b34b6ffa9d4aae16272cbdbf508134f98b4647d4.tar.gz
bcm5719-llvm-b34b6ffa9d4aae16272cbdbf508134f98b4647d4.zip
[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
Diffstat (limited to 'clang-tools-extra/test')
-rw-r--r--clang-tools-extra/test/clang-tidy/modernize-use-using.cpp21
1 files changed, 21 insertions, 0 deletions
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 <typename T>
+class C {
+ protected:
+ typedef C<T> super;
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use 'using' instead of 'typedef'
+ // CHECK-FIXES: using super = C<T>;
+ virtual void f();
+
+public:
+ virtual ~C();
+};
+
+class D : public C<D> {
+ void f() override { super::f(); }
+};
+class E : public C<E> {
+ void f() override { super::f(); }
+};
+}
OpenPOWER on IntegriCloud