//===----------------------------------------------------------------------===//
DeclContext *Sema::getFunctionLevelDeclContext() {
- DeclContext *DC = CurContext;
+ DeclContext *DC = PreDeclaratorDC ? PreDeclaratorDC : CurContext;
+
while (isa<BlockDecl>(DC))
DC = DC->getParent();
class A {
void f() __attribute__((deprecated));
void g(A* a);
+ void h(A* a) __attribute__((deprecated));
int b __attribute__((deprecated));
};
(void)b; // expected-warning{{'b' is deprecated}}
(void)a->b; // expected-warning{{'b' is deprecated}}
}
+
+void A::h(A* a)
+{
+ f();
+ a->f();
+
+ (void)b;
+ (void)a->b;
+}