-literal to char* conversion. Make it so.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127586
91177308-0d34-0410-b5e6-
96231b3b80d8
ImpCastExprToType(From, ToType.getNonLValueExprType(Context),
CK_NoOp, VK);
- if (SCS.DeprecatedStringLiteralToCharPtr)
+ if (SCS.DeprecatedStringLiteralToCharPtr &&
+ !getLangOptions().WritableStrings)
Diag(From->getLocStart(), diag::warn_deprecated_string_literal_conversion)
<< ToType.getNonReferenceType();
// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated-writable-strings -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fwritable-strings -verify %s
// rdar://8827606
char *fun(void)