aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorJean-Daniel Dupas <devlists@shadowlab.org>2012-01-25 10:35:33 +0000
committerJean-Daniel Dupas <devlists@shadowlab.org>2012-01-25 10:35:33 +0000
commite98e5b54543f8a9e35626fb44dc0c649e71917d9 (patch)
tree3d9aef8e2c18ce516d3c12aae9a2a0881abec340 /lib/Sema/SemaChecking.cpp
parent4d7ff6e8639bdce74e39b90370729ad0179ebcca (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.cpp4
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) {