Make sure to diagnose use of declarations in the case where we create an implicit CXXThisExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78474 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/attr-deprecated.cpp b/test/SemaCXX/attr-deprecated.cpp
new file mode 100644
index 0000000..a647d81
--- /dev/null
+++ b/test/SemaCXX/attr-deprecated.cpp
@@ -0,0 +1,16 @@
+// RUN: clang-cc %s -verify -fsyntax-only
+class A {
+ void f() __attribute__((deprecated));
+ void g(A* a);
+
+ int b __attribute__((deprecated));
+};
+
+void A::g(A* a)
+{
+ f(); // expected-warning{{'f' is deprecated}}
+ a->f(); // expected-warning{{'f' is deprecated}}
+
+ (void)b; // expected-warning{{'b' is deprecated}}
+ (void)a->b; // expected-warning{{'b' is deprecated}}
+}