Add support for -Wwrite-strings.  Patch by Mike M!  Fixes PR 4804.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98541 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index cd049a2..a39ba2f 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -370,7 +370,7 @@
   if (Literal.Pascal) StrTy = Context.UnsignedCharTy;
 
   // A C++ string literal has a const-qualified element type (C++ 2.13.4p1).
-  if (getLangOptions().CPlusPlus)
+  if (getLangOptions().CPlusPlus || getLangOptions().ConstStrings )
     StrTy.addConst();
 
   // Get an array type for the string, according to C99 6.4.5.  This includes