diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td --- a/clang/include/clang/Basic/DiagnosticCommonKinds.td +++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td @@ -305,7 +305,8 @@ // Sema && Serialization def warn_dup_category_def : Warning< - "duplicate definition of category %1 on interface %0">; + "duplicate definition of category %1 on interface %0">, + InGroup>; // Targets diff --git a/clang/test/SemaObjC/check-dup-objc-decls-1.m b/clang/test/SemaObjC/check-dup-objc-decls-1.m --- a/clang/test/SemaObjC/check-dup-objc-decls-1.m +++ b/clang/test/SemaObjC/check-dup-objc-decls-1.m @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class -Wno-objc-duplicate-category-definition -DIGNORE_DUP_CAT %s @interface Foo // expected-note {{previous definition is here}} @end @@ -41,8 +42,13 @@ @protocol DP @end #pragma clang diagnostic pop -@interface A(Cat)

@end // expected-note {{previous definition is here}} -@interface A(Cat) @end // expected-warning {{duplicate definition of category 'Cat' on interface 'A'}} +@interface A(Cat)

@end +@interface A(Cat) @end + +#ifndef IGNORE_DUP_CAT +// expected-note@-4 {{previous definition is here}} +// expected-warning@-4 {{duplicate definition of category 'Cat' on interface 'A'}} +#endif // rdar 7626768 @class NSString;