diff options
author | Jean-Daniel Dupas <devlists@shadowlab.org> | 2012-01-25 10:35:33 +0000 |
---|---|---|
committer | Jean-Daniel Dupas <devlists@shadowlab.org> | 2012-01-25 10:35:33 +0000 |
commit | e98e5b54543f8a9e35626fb44dc0c649e71917d9 (patch) | |
tree | 3d9aef8e2c18ce516d3c12aae9a2a0881abec340 /lib/Sema/SemaChecking.cpp | |
parent | 4d7ff6e8639bdce74e39b90370729ad0179ebcca (diff) |
Add support for const pointer to literal-objc string as format attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148948 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index f5a8b448a1..950a575891 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -1441,6 +1441,10 @@ bool Sema::SemaCheckStringLiteral(const Expr *E, Expr **Args, } else if (const PointerType *PT = T->getAs<PointerType>()) { isConstant = T.isConstant(Context) && PT->getPointeeType().isConstant(Context); + } else if (T->isObjCObjectPointerType()) { + // In ObjC, there is usually no "const ObjectPointer" type, + // so don't check if the pointee type is constant. + isConstant = T.isConstant(Context); } if (isConstant) { |