diff options
author | John McCall <rjmccall@apple.com> | 2010-03-15 10:54:44 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-03-15 10:54:44 +0000 |
commit | 4b7a834e0fecddd9eaf1f4567867c718e4eebf50 (patch) | |
tree | 471936c6aa4ed9131fd806b34e4d4df42807c62d /lib/Sema/SemaExprObjC.cpp | |
parent | b6217665c6a987f2d6c8665fd70365d7719ac4df (diff) |
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
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index c60455d845..c98ba435c7 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -106,7 +106,7 @@ Expr *Sema::BuildObjCEncodeExpression(SourceLocation AtLoc, // which is an array type. StrTy = Context.CharTy; // A C++ string literal has a const-qualified element type (C++ 2.13.4p1). - if (getLangOptions().CPlusPlus) + if (getLangOptions().CPlusPlus || getLangOptions().ConstStrings) StrTy.addConst(); StrTy = Context.getConstantArrayType(StrTy, llvm::APInt(32, Str.size()+1), ArrayType::Normal, 0); |