diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/DelayedDiagnostic.cpp | 6 | ||||
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/lib/Sema/DelayedDiagnostic.cpp b/lib/Sema/DelayedDiagnostic.cpp index d6c1ad13a8..876f9d7a95 100644 --- a/lib/Sema/DelayedDiagnostic.cpp +++ b/lib/Sema/DelayedDiagnostic.cpp @@ -20,13 +20,15 @@ using namespace clang; using namespace sema; DelayedDiagnostic DelayedDiagnostic::makeDeprecation(SourceLocation Loc, - const NamedDecl *D, - StringRef Msg) { + const NamedDecl *D, + const ObjCInterfaceDecl *UnknownObjCClass, + StringRef Msg) { DelayedDiagnostic DD; DD.Kind = Deprecation; DD.Triggered = false; DD.Loc = Loc; DD.DeprecationData.Decl = D; + DD.DeprecationData.UnknownObjCClass = UnknownObjCClass; char *MessageData = 0; if (Msg.size()) { MessageData = new char [Msg.size()]; diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 4f3b03f6e5..37edeff0ec 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -4121,6 +4121,11 @@ void Sema::HandleDelayedDeprecationCheck(DelayedDiagnostic &DD, Diag(DD.Loc, diag::warn_deprecated_message) << DD.getDeprecationDecl()->getDeclName() << DD.getDeprecationMessage(); + else if (DD.getUnknownObjCClass()) { + Diag(DD.Loc, diag::warn_deprecated_fwdclass_message) + << DD.getDeprecationDecl()->getDeclName(); + Diag(DD.getUnknownObjCClass()->getLocation(), diag::note_forward_class); + } else Diag(DD.Loc, diag::warn_deprecated) << DD.getDeprecationDecl()->getDeclName(); @@ -4131,7 +4136,9 @@ void Sema::EmitDeprecationWarning(NamedDecl *D, StringRef Message, const ObjCInterfaceDecl *UnknownObjCClass) { // Delay if we're currently parsing a declaration. if (DelayedDiagnostics.shouldDelayDiagnostics()) { - DelayedDiagnostics.add(DelayedDiagnostic::makeDeprecation(Loc, D, Message)); + DelayedDiagnostics.add(DelayedDiagnostic::makeDeprecation(Loc, D, + UnknownObjCClass, + Message)); return; } |