r242980 - Add test to verify we emit warning when the deprecated virtual function is overloaded.

Davide Italiano davide at freebsd.org
Wed Jul 22 19:54:59 PDT 2015


Author: davide
Date: Wed Jul 22 21:54:59 2015
New Revision: 242980

URL: http://llvm.org/viewvc/llvm-project?rev=242980&view=rev
Log:
Add test to verify we emit warning when the deprecated virtual function is overloaded.

Suggested by Richard Smith.

Modified:
    cfe/trunk/test/SemaCXX/attr-deprecated.cpp

Modified: cfe/trunk/test/SemaCXX/attr-deprecated.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-deprecated.cpp?rev=242980&r1=242979&r2=242980&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/attr-deprecated.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-deprecated.cpp Wed Jul 22 21:54:59 2015
@@ -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}}
 }
 
 





More information about the cfe-commits mailing list