diff options
| author | Devin Coughlin <dcoughlin@apple.com> | 2016-02-05 04:22:15 +0000 |
|---|---|---|
| committer | Devin Coughlin <dcoughlin@apple.com> | 2016-02-05 04:22:15 +0000 |
| commit | 084e363517fc2248412f227862cdabd2f439e83d (patch) | |
| tree | 0f484f8cb46289dfece0d2e114dd507c75dde9b0 /clang/test | |
| parent | d0807aee51b7a19a58d8b4c2044bc17a5fddf545 (diff) | |
| download | bcm5719-llvm-084e363517fc2248412f227862cdabd2f439e83d.tar.gz bcm5719-llvm-084e363517fc2248412f227862cdabd2f439e83d.zip | |
[analyzer] Suppress localization diagnostics in debug classes and methods.
If the class or method name case-insensitively contains the term "debug",
suppress warnings about string constants flowing to user-facing UI APIs.
llvm-svn: 259875
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Analysis/localization.m | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Analysis/localization.m b/clang/test/Analysis/localization.m index ce55609b1bf..cf0697c76f5 100644 --- a/clang/test/Analysis/localization.m +++ b/clang/test/Analysis/localization.m @@ -90,6 +90,13 @@ NSString *KHLocalizedString(NSString* key, NSString* comment) { [testLabel setText:bar]; // no-warning } + +// Suppress diagnostic about user-facing string constants when the method name +// contains the term "Debug". +- (void)debugScreen:(UILabel *)label { + label.text = @"Unlocalized"; +} + // Plural Misuse Checker Tests // These tests are modeled off incorrect uses of the many-one pattern // from real projects. @@ -205,3 +212,15 @@ NSString *KHLocalizedString(NSString* key, NSString* comment) { // } @end + + +// Suppress diagnostic about user-facing string constants when the class name +// contains "Debug" +@interface MyDebugView : NSObject +@end + +@implementation MyDebugView +- (void)setupScreen:(UILabel *)label { + label.text = @"Unlocalized"; +} +@end |

