[cfe-commits] r158783 - in /cfe/trunk: lib/Edit/RewriteObjCFoundationAPI.cpp test/ARCMT/objcmt-boxing.m test/ARCMT/objcmt-boxing.m.result
Argyrios Kyrtzidis
akyrtzi at gmail.com
Tue Jun 19 18:28:33 PDT 2012
Author: akirtzidis
Date: Tue Jun 19 20:28:32 2012
New Revision: 158783
URL: http://llvm.org/viewvc/llvm-project?rev=158783&view=rev
Log:
[objcmt] Have the modern objc migration warning change from:
[NSNumber numberWithDouble:cppb];
warning: converting to boxing syntax requires a cast
to something like:
[NSNumber numberWithDouble:cppb];
warning: converting to boxing syntax requires casting 'bool' to 'double'
This is way better to fully understand the warning.
rdar://11705106
Modified:
cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp
cfe/trunk/test/ARCMT/objcmt-boxing.m
cfe/trunk/test/ARCMT/objcmt-boxing.m.result
Modified: cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp?rev=158783&r1=158782&r2=158783&view=diff
==============================================================================
--- cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp (original)
+++ cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp Tue Jun 19 20:28:32 2012
@@ -852,8 +852,9 @@
DiagnosticsEngine &Diags = Ctx.getDiagnostics();
// FIXME: Use a custom category name to distinguish migration diagnostics.
unsigned diagID = Diags.getCustomDiagID(DiagnosticsEngine::Warning,
- "converting to boxing syntax requires a cast");
- Diags.Report(Msg->getExprLoc(), diagID) << Msg->getSourceRange();
+ "converting to boxing syntax requires casting %0 to %1");
+ Diags.Report(Msg->getExprLoc(), diagID) << OrigTy << FinalTy
+ << Msg->getSourceRange();
return false;
}
Modified: cfe/trunk/test/ARCMT/objcmt-boxing.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-boxing.m?rev=158783&r1=158782&r2=158783&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-boxing.m (original)
+++ cfe/trunk/test/ARCMT/objcmt-boxing.m Tue Jun 19 20:28:32 2012
@@ -81,7 +81,7 @@
MyEnm myenum;
[NSNumber numberWithInteger:myenum];
[NSNumber numberWithInteger:ME_foo];
- [NSNumber numberWithDouble:cppb]; // expected-warning {{converting to boxing syntax requires a cast}}
+ [NSNumber numberWithDouble:cppb]; // expected-warning {{converting to boxing syntax requires casting 'bool' to 'double'}}
}
void boxString() {
Modified: cfe/trunk/test/ARCMT/objcmt-boxing.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-boxing.m.result?rev=158783&r1=158782&r2=158783&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-boxing.m.result (original)
+++ cfe/trunk/test/ARCMT/objcmt-boxing.m.result Tue Jun 19 20:28:32 2012
@@ -81,7 +81,7 @@
MyEnm myenum;
@(myenum);
@(ME_foo);
- [NSNumber numberWithDouble:cppb]; // expected-warning {{converting to boxing syntax requires a cast}}
+ [NSNumber numberWithDouble:cppb]; // expected-warning {{converting to boxing syntax requires casting 'bool' to 'double'}}
}
void boxString() {
More information about the cfe-commits
mailing list