summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp
index 3da15a359c8..5f7a4dd91d4 100644
--- a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp
+++ b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp
@@ -271,3 +271,21 @@ void PositiveMessageAndFixAsFunctionIsCalled(ExpensiveToCopyType A) {
void ReferenceFunctionByCallingIt() {
PositiveMessageAndFixAsFunctionIsCalled(ExpensiveToCopyType());
}
+
+// Virtual method overrides of dependent types cannot be recognized unless they
+// are marked as override or final. Test that check is not triggered on methods
+// marked with override or final.
+template <typename T>
+struct NegativeDependentTypeInterface {
+ virtual void Method(ExpensiveToCopyType E) = 0;
+};
+
+template <typename T>
+struct NegativeOverrideImpl : public NegativeDependentTypeInterface<T> {
+ void Method(ExpensiveToCopyType E) override {}
+};
+
+template <typename T>
+struct NegativeFinalImpl : public NegativeDependentTypeInterface<T> {
+ void Method(ExpensiveToCopyType E) final {}
+};
OpenPOWER on IntegriCloud