summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2016-03-15 20:56:38 +0000
committerBob Wilson <bob.wilson@apple.com>2016-03-15 20:56:38 +0000
commit57819fc809d1a72e253233930bbd06f13fb9bae6 (patch)
tree732cab7e54e904040185c40282a3aea9b90d21b0 /clang/test/SemaObjC
parent20c1e4e69d05e56d270e8380679c8735bac2c6d2 (diff)
downloadbcm5719-llvm-57819fc809d1a72e253233930bbd06f13fb9bae6.tar.gz
bcm5719-llvm-57819fc809d1a72e253233930bbd06f13fb9bae6.zip
Move the fixit for -Wformat-security to a note.
r263299 added a fixit for the -Wformat-security warning, but that runs into complications with our guideline that error recovery should be done as-if the fixit had been applied. Putting the fixit on a note avoids that. llvm-svn: 263584
Diffstat (limited to 'clang/test/SemaObjC')
-rw-r--r--clang/test/SemaObjC/format-strings-objc-fixit.m31
-rw-r--r--clang/test/SemaObjC/format-strings-objc.m1
2 files changed, 1 insertions, 31 deletions
diff --git a/clang/test/SemaObjC/format-strings-objc-fixit.m b/clang/test/SemaObjC/format-strings-objc-fixit.m
deleted file mode 100644
index feaebeec57f..00000000000
--- a/clang/test/SemaObjC/format-strings-objc-fixit.m
+++ /dev/null
@@ -1,31 +0,0 @@
-// RUN: cp %s %t
-// RUN: %clang_cc1 -x objective-c -triple x86_64-apple-darwin -Wno-objc-root-class -pedantic -Wall -fixit %t
-// RUN: %clang_cc1 -x objective-c -triple x86_64-apple-darwin -Wno-objc-root-class -fsyntax-only -pedantic -Wall -Werror %t
-// RUN: %clang_cc1 -x objective-c -triple x86_64-apple-darwin -Wno-objc-root-class -E -o - %t | FileCheck %s
-
-typedef signed char BOOL;
-typedef unsigned int NSUInteger;
-typedef struct _NSZone NSZone;
-@class NSCoder, NSString, NSEnumerator;
-@protocol NSObject - (BOOL)isEqual:(id)object; @end
-@protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end
-@protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; @end
-@protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; @end
-@interface NSObject <NSObject> {} @end
-@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding> - (NSUInteger)length; @end
-extern void NSLog(NSString *format, ...);
-
-/* This is a test of the various code modification hints that are
- provided as part of warning or extension diagnostics. All of the
- warnings will be fixed by -fixit, and the resulting file should
- compile cleanly with -Werror -pedantic. */
-
-extern NSString *NonliteralString;
-
-void test() {
- // nonliteral format
- NSLog(NonliteralString);
-}
-
-// Validate the fixes.
-// CHECK: NSLog(@"%@", NonliteralString);
diff --git a/clang/test/SemaObjC/format-strings-objc.m b/clang/test/SemaObjC/format-strings-objc.m
index 079460cc76c..a1ebf03f8ef 100644
--- a/clang/test/SemaObjC/format-strings-objc.m
+++ b/clang/test/SemaObjC/format-strings-objc.m
@@ -116,6 +116,7 @@ NSString *test_literal_propagation(void) {
NSLog(ns2); // expected-warning {{more '%' conversions than data arguments}}
NSString * ns3 = ns1;
NSLog(ns3); // expected-warning {{format string is not a string literal}}}
+ // expected-note@-1{{treat the string as an argument to avoid this}}
NSString * const ns6 = @"split" " string " @"%s"; // expected-note {{format string is defined here}}
NSLog(ns6); // expected-warning {{more '%' conversions than data arguments}}
OpenPOWER on IntegriCloud