summaryrefslogtreecommitdiff
path: root/test/SemaCXX/attr-deprecated.cpp
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2015-07-23 02:54:59 +0000
committerDavide Italiano <davide@freebsd.org>2015-07-23 02:54:59 +0000
commitb3a41e9bfa7c173d21dff0d8026d77ec45a4fc11 (patch)
tree539f0c15b5ffdd83a81c77bfce383e9583c8f927 /test/SemaCXX/attr-deprecated.cpp
parent577ec0fa8ab3a07d9d29b1d84e5948df018b1b99 (diff)
downloadclang-b3a41e9bfa7c173d21dff0d8026d77ec45a4fc11.tar.gz
Add test to verify we emit warning when the deprecated virtual function is overloaded.
Suggested by Richard Smith. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242980 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/attr-deprecated.cpp')
-rw-r--r--test/SemaCXX/attr-deprecated.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/SemaCXX/attr-deprecated.cpp b/test/SemaCXX/attr-deprecated.cpp
index 4066dc16d6..eab5a1c0ec 100644
--- a/test/SemaCXX/attr-deprecated.cpp
+++ b/test/SemaCXX/attr-deprecated.cpp
@@ -57,12 +57,18 @@ void f(B* b, C *c) {
struct D {
virtual void f() __attribute__((deprecated));
+ virtual void f(int) __attribute__((deprecated));
+ virtual void f(int, int) __attribute__((deprecated));
};
void D::f() { } // expected-note{{'f' has been explicitly marked deprecated here}}
+void D::f(int v) { } // expected-note{{'f' has been explicitly marked deprecated here}}
+void D::f(int v1, int v2) { } // expected-note{{'f' has been explicitly marked deprecated here}}
void f(D* d) {
d->f(); // expected-warning{{'f' is deprecated}}
+ d->f(42); // expected-warning{{'f' is deprecated}}
+ d->f(42, 24); // expected-warning{{'f' is deprecated}}
}