When we're performing an explicit cast of some sort, don't complain
about deprecated Objective-C pointer conversions. Plus, make sure to
actually set an appropriate AssignmentAction when performing an
implicit conversion from an InitializationSequence. Fixes regressions
in the GCC DejaGNU testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120744 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index f6bfee9..fceb542 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1732,7 +1732,7 @@
}
else
assert(0 && "Unknown conversion function kind!");
- // Whatch out for elipsis conversion.
+ // Watch out for elipsis conversion.
if (!ICS.UserDefined.EllipsisConversion) {
if (PerformImplicitConversion(From, BeforeToType,
ICS.UserDefined.Before, AA_Converting,
@@ -1925,7 +1925,7 @@
break;
case ICK_Pointer_Conversion: {
- if (SCS.IncompatibleObjC) {
+ if (SCS.IncompatibleObjC && Action != AA_Casting) {
// Diagnose incompatible Objective-C conversions
Diag(From->getSourceRange().getBegin(),
diag::ext_typecheck_convert_incompatible_pointer)