aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2011-12-15 00:38:15 +0000
committerRichard Trieu <rtrieu@google.com>2011-12-15 00:38:15 +0000
commit2fe9b7fb07dff15dd15dd8755a9a9e6de0fe46fc (patch)
tree29e2aab8ed6d3dda663e31e3ed5434a0d3e26163
parent60ef308e51c71b760d7f598c1b763ceb7b768148 (diff)
Modify how the -verify flag works. Currently, the verification string and
diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146619 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Frontend/VerifyDiagnosticConsumer.cpp3
-rw-r--r--test/ARCMT/nonobjc-to-objc-cast-2.m2
-rw-r--r--test/Analysis/CFDateGC.m4
-rw-r--r--test/Analysis/NSString.m14
-rw-r--r--test/Analysis/method-arg-decay.m2
-rw-r--r--test/Analysis/retain-release-path-notes-gc.m8
-rw-r--r--test/Analysis/retain-release-path-notes.m4
-rw-r--r--test/Analysis/retain-release-region-store.m2
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.argdep/p2.cpp2
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp2
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp2
-rw-r--r--test/CXX/basic/basic.start/basic.start.main/p2f.cpp4
-rw-r--r--test/CXX/class.access/p6.cpp2
-rw-r--r--test/CXX/class.derived/class.member.lookup/p6.cpp2
-rw-r--r--test/CXX/class/class.friend/p1.cpp18
-rw-r--r--test/CXX/class/class.mem/p13.cpp2
-rw-r--r--test/CXX/class/class.nest/p1-cxx0x.cpp2
-rw-r--r--test/CXX/class/class.nest/p1.cpp4
-rw-r--r--test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp4
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp4
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/p3-0x.cpp2
-rw-r--r--test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-cxx03-extra-copy.cpp4
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.ref/p5.cpp2
-rw-r--r--test/CXX/over/over.over/p2-resolve-single-template-id.cpp2
-rw-r--r--test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp2
-rw-r--r--test/FixIt/typo.c2
-rw-r--r--test/Lexer/rdr-6096838-2.c2
-rw-r--r--test/Lexer/string-literal-encoding.c12
-rw-r--r--test/Lexer/string_concat.cpp48
-rw-r--r--test/Misc/diag-aka-types.cpp2
-rw-r--r--test/Misc/diag-verify.cpp48
-rw-r--r--test/Modules/macros.c2
-rw-r--r--test/Modules/normal-module-map.cpp2
-rw-r--r--test/PCH/typo.cpp4
-rw-r--r--test/Parser/attr-availability.c2
-rw-r--r--test/Parser/check-syntax-1.m2
-rw-r--r--test/Parser/cxx-altivec.cpp2
-rw-r--r--test/Parser/cxx-typeid.cpp2
-rw-r--r--test/Parser/cxx0x-lambda-expressions.cpp4
-rw-r--r--test/Parser/objc-category-neg-1.m2
-rw-r--r--test/Parser/objc-forcollection-neg-2.m2
-rw-r--r--test/Parser/objc-init.m2
-rw-r--r--test/Parser/recovery.c2
-rw-r--r--test/Sema/attr-unavailable-message.c4
-rw-r--r--test/Sema/block-misc.c2
-rw-r--r--test/Sema/builtins.c2
-rw-r--r--test/Sema/format-strings-size_t.c8
-rw-r--r--test/Sema/implicit-builtin-redecl.c2
-rw-r--r--test/Sema/overloadable-complex.c4
-rw-r--r--test/Sema/overloadable.c2
-rw-r--r--test/Sema/thread-specifier.c4
-rw-r--r--test/SemaCXX/MicrosoftCompatibility.cpp4
-rw-r--r--test/SemaCXX/access.cpp2
-rw-r--r--test/SemaCXX/addr-of-overloaded-function.cpp12
-rw-r--r--test/SemaCXX/class.cpp24
-rw-r--r--test/SemaCXX/complex-overload.cpp2
-rw-r--r--test/SemaCXX/dcl_init_aggr.cpp2
-rw-r--r--test/SemaCXX/exceptions.cpp24
-rw-r--r--test/SemaCXX/explicit.cpp2
-rw-r--r--test/SemaCXX/incomplete-call.cpp2
-rw-r--r--test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp4
-rw-r--r--test/SemaCXX/overload-call.cpp26
-rw-r--r--test/SemaCXX/overload-member-call.cpp8
-rw-r--r--test/SemaCXX/overloaded-operator.cpp2
-rw-r--r--test/SemaCXX/reinterpret-fn-obj-pedantic.cpp4
-rw-r--r--test/SemaCXX/scope-check.cpp2
-rw-r--r--test/SemaCXX/statements.cpp2
-rw-r--r--test/SemaCXX/this.cpp4
-rw-r--r--test/SemaCXX/typeid.cpp2
-rw-r--r--test/SemaCXX/uninit-variables.cpp2
-rw-r--r--test/SemaCXX/warn-bool-conversion.cpp12
-rw-r--r--test/SemaCXX/warn-thread-safety-analysis.cpp14
-rw-r--r--test/SemaCXX/warn-thread-safety-parsing.cpp2
-rw-r--r--test/SemaObjC/arc.m8
-rw-r--r--test/SemaObjC/attr-deprecated.m8
-rw-r--r--test/SemaObjC/blocks.m8
-rw-r--r--test/SemaObjC/call-super-2.m4
-rw-r--r--test/SemaObjC/category-1.m2
-rw-r--r--test/SemaObjC/class-extension-dup-methods.m4
-rw-r--r--test/SemaObjC/compare-qualified-id.m2
-rw-r--r--test/SemaObjC/comptypes-1.m2
-rw-r--r--test/SemaObjC/comptypes-7.m4
-rw-r--r--test/SemaObjC/conditional-expr-3.m2
-rw-r--r--test/SemaObjC/conditional-expr.m4
-rw-r--r--test/SemaObjC/gcc-cast-ext.m4
-rw-r--r--test/SemaObjC/invalid-objc-decls-1.m4
-rw-r--r--test/SemaObjC/ivar-lookup.m2
-rw-r--r--test/SemaObjC/method-bad-param.m12
-rw-r--r--test/SemaObjC/method-not-defined.m2
-rw-r--r--test/SemaObjC/method-undef-category-warn-1.m8
-rw-r--r--test/SemaObjC/method-undef-extension-warn-1.m2
-rw-r--r--test/SemaObjC/missing-method-return-type.m4
-rw-r--r--test/SemaObjC/no-protocol-option-tests.m2
-rw-r--r--test/SemaObjC/property-9.m4
-rw-r--r--test/SemaObjC/property-lookup-in-id.m2
-rw-r--r--test/SemaObjC/scope-check.m28
-rw-r--r--test/SemaObjC/special-dep-unavail-warning.m2
-rw-r--r--test/SemaObjC/super.m2
-rw-r--r--test/SemaObjC/try-catch.m2
-rw-r--r--test/SemaObjC/undef-protocol-methods-1.m2
-rw-r--r--test/SemaObjC/warn-implicit-atomic-property.m4
-rw-r--r--test/SemaObjC/warn-strict-selector-match.m6
-rw-r--r--test/SemaObjCXX/warn-strict-selector-match.mm4
-rw-r--r--test/SemaTemplate/explicit-instantiation.cpp2
-rw-r--r--test/SemaTemplate/friend.cpp2
-rw-r--r--test/SemaTemplate/instantiate-expr-5.cpp2
106 files changed, 313 insertions, 264 deletions
diff --git a/lib/Frontend/VerifyDiagnosticConsumer.cpp b/lib/Frontend/VerifyDiagnosticConsumer.cpp
index cf35c8edc3..5eeb696582 100644
--- a/lib/Frontend/VerifyDiagnosticConsumer.cpp
+++ b/lib/Frontend/VerifyDiagnosticConsumer.cpp
@@ -119,8 +119,7 @@ public:
}
virtual bool Match(const std::string &S) {
- return S.find(Text) != std::string::npos ||
- Text.find(S) != std::string::npos;
+ return S.find(Text) != std::string::npos;
}
};
diff --git a/test/ARCMT/nonobjc-to-objc-cast-2.m b/test/ARCMT/nonobjc-to-objc-cast-2.m
index 2900b9a1fe..ba4efd3f5a 100644
--- a/test/ARCMT/nonobjc-to-objc-cast-2.m
+++ b/test/ARCMT/nonobjc-to-objc-cast-2.m
@@ -20,7 +20,7 @@ void f(BOOL b) {
void f2(NSString *s) {
CFStringRef ref;
ref = [(CFStringRef)[s string] retain]; // expected-error {{cast of Objective-C pointer type 'id' to C pointer type 'CFStringRef' (aka 'const struct __CFString *') requires a bridged cast}} \
- // expected-error {{ bad receiver type 'CFStringRef' (aka 'const struct __CFString *')}} \
+ // expected-error {{bad receiver type 'CFStringRef' (aka 'const struct __CFString *')}} \
// expected-note{{use __bridge to convert directly (no change in ownership)}} \
// expected-note{{use __bridge_retained to make an ARC object available as a +1 'CFStringRef' (aka 'const struct __CFString *')}}
}
diff --git a/test/Analysis/CFDateGC.m b/test/Analysis/CFDateGC.m
index 69b99f052b..4884bb9ea8 100644
--- a/test/Analysis/CFDateGC.m
+++ b/test/Analysis/CFDateGC.m
@@ -42,7 +42,7 @@ CFAbsoluteTime f1_use_after_release() {
[NSMakeCollectable(date) release];
CFDateGetAbsoluteTime(date); // no-warning
CFRelease(date);
- t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released.}}
+ t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released}}
return t;
}
@@ -55,7 +55,7 @@ CFAbsoluteTime f2_use_after_release() {
[(id) CFMakeCollectable(date) release];
CFDateGetAbsoluteTime(date); // no-warning
CFRelease(date);
- t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released.}}
+ t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released}}
return t;
}
diff --git a/test/Analysis/NSString.m b/test/Analysis/NSString.m
index 48450daa01..4add37b975 100644
--- a/test/Analysis/NSString.m
+++ b/test/Analysis/NSString.m
@@ -97,31 +97,31 @@ extern void *_NSConstantStringClassReference;
NSComparisonResult f1(NSString* s) {
NSString *aString = 0;
- return [s compare:aString]; // expected-warning {{Argument to 'NSString' method 'compare:' cannot be nil.}}
+ return [s compare:aString]; // expected-warning {{Argument to 'NSString' method 'compare:' cannot be nil}}
}
NSComparisonResult f2(NSString* s) {
NSString *aString = 0;
- return [s caseInsensitiveCompare:aString]; // expected-warning {{Argument to 'NSString' method 'caseInsensitiveCompare:' cannot be nil.}}
+ return [s caseInsensitiveCompare:aString]; // expected-warning {{Argument to 'NSString' method 'caseInsensitiveCompare:' cannot be nil}}
}
NSComparisonResult f3(NSString* s, NSStringCompareOptions op) {
NSString *aString = 0;
- return [s compare:aString options:op]; // expected-warning {{Argument to 'NSString' method 'compare:options:' cannot be nil.}}
+ return [s compare:aString options:op]; // expected-warning {{Argument to 'NSString' method 'compare:options:' cannot be nil}}
}
NSComparisonResult f4(NSString* s, NSStringCompareOptions op, NSRange R) {
NSString *aString = 0;
- return [s compare:aString options:op range:R]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:' cannot be nil.}}
+ return [s compare:aString options:op range:R]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:' cannot be nil}}
}
NSComparisonResult f5(NSString* s, NSStringCompareOptions op, NSRange R) {
NSString *aString = 0;
- return [s compare:aString options:op range:R locale:0]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:locale:' cannot be nil.}}
+ return [s compare:aString options:op range:R locale:0]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:locale:' cannot be nil}}
}
NSArray *f6(NSString* s) {
- return [s componentsSeparatedByCharactersInSet:0]; // expected-warning {{Argument to 'NSString' method 'componentsSeparatedByCharactersInSet:' cannot be nil.}}
+ return [s componentsSeparatedByCharactersInSet:0]; // expected-warning {{Argument to 'NSString' method 'componentsSeparatedByCharactersInSet:' cannot be nil}}
}
NSString* f7(NSString* s1, NSString* s2, NSString* s3) {
@@ -189,7 +189,7 @@ void f13(void) {
@end
void f14(MyString *s) {
- [s compare:0]; // expected-warning {{Argument to 'MyString' method 'compare:' cannot be nil.}}
+ [s compare:0]; // expected-warning {{Argument to 'MyString' method 'compare:' cannot be nil}}
}
// Test regular use of -autorelease
diff --git a/test/Analysis/method-arg-decay.m b/test/Analysis/method-arg-decay.m
index 9ce88b2423..ffe28afc4d 100644
--- a/test/Analysis/method-arg-decay.m
+++ b/test/Analysis/method-arg-decay.m
@@ -73,7 +73,7 @@ extern NSMutableArray *XCFindPossibleKeyModules(PBXModule *module, BOOL useExpos
- (PBXModule *) moduleForTab:(NSTabViewItem *)item; // expected-note {{method definition for 'moduleForTab:' not found}}
@end
@implementation XCPerspectiveModule // expected-warning {{incomplete implementation}} \
- // expected-warning {{method in protocol not implemented [-Wprotocol]}}
+ // expected-warning {{method in protocol not implemented}}
+ (void) openForProjectDocument:(PBXProjectDocument *)projectDocument {
}
- (PBXModule *) type:(Class)type inPerspective:(id)perspectiveIdentifer matchingFunction:(BOOL (void *, void *))comparator usingData:(void *)data {
diff --git a/test/Analysis/retain-release-path-notes-gc.m b/test/Analysis/retain-release-path-notes-gc.m
index 19e6d7b8b3..1e74f003e1 100644
--- a/test/Analysis/retain-release-path-notes-gc.m
+++ b/test/Analysis/retain-r