// Initialize language-specific preprocessor defines.
- // FIXME: Implement magic like cpp_init_builtins for things like __STDC__
- // and __DATE__ etc.
// These should all be defined in the preprocessor according to the
// current language configuration.
if (!PP.getLangOptions().Microsoft)
// error cases.
if (MemberDecl->isInvalidDecl())
return ExprError();
+
+ // Check if referencing a field with __attribute__((deprecated)).
+ DiagnoseUseOfDeprecatedDecl(MemberDecl, MemberLoc);
if (FieldDecl *FD = dyn_cast<FieldDecl>(MemberDecl)) {
// We may have found a field within an anonymous union or struct
return old_fn()+1; // no warning, deprecated functions can use deprecated symbols.
}
+
+struct foo {
+ int x __attribute__((deprecated));
+};
+
+void test1(struct foo *F) {
+ ++F->x; // expected-warning {{'x' is deprecated}}
+}