aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/test
diff options
context:
space:
mode:
authorPiotr Zegar <me@piotrzegar.pl>2025-07-23 21:51:58 +0200
committerGitHub <noreply@github.com>2025-07-23 21:51:58 +0200
commit478130545bc41a8bb80304e5d931559a9d2b6171 (patch)
tree65f7afcf86dddcd8ec6906f3cbedb7694704c872 /clang-tools-extra/test
parent20a79027ca58bbde563f9a914e4ada71301eb50a (diff)
downloadllvm-478130545bc41a8bb80304e5d931559a9d2b6171.zip
llvm-478130545bc41a8bb80304e5d931559a9d2b6171.tar.gz
llvm-478130545bc41a8bb80304e5d931559a9d2b6171.tar.bz2
[clang-tidy] Ignore pure-virtual in portability-template... (#150290)
Ignore pure virtual member functions in portability-template-virtual-member-function check. Those functions will be represented in vtable as __cxa_pure_virtual or something similar. Fixes #139031.
Diffstat (limited to 'clang-tools-extra/test')
-rw-r--r--clang-tools-extra/test/clang-tidy/checkers/portability/template-virtual-member-function.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/checkers/portability/template-virtual-member-function.cpp b/clang-tools-extra/test/clang-tidy/checkers/portability/template-virtual-member-function.cpp
index 94786ae..2a67b79 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/portability/template-virtual-member-function.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/portability/template-virtual-member-function.cpp
@@ -171,3 +171,20 @@ struct NoInstantiation<int, U>{
};
};
} // namespace PartialSpecializationNoInstantiation
+
+namespace PureVirtual {
+
+template<typename T>
+struct Base {
+ virtual void foo() = 0;
+};
+
+struct Derived : public Base<int> {
+ void foo() {}
+};
+
+void test() {
+ Derived{}.foo();
+}
+
+}