aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-08-18 22:49:54 +0000
committerChris Lattner <sabre@nondot.org>2008-08-18 22:49:54 +0000
commit43477ca46792311640cf29b7cff731e29bebb146 (patch)
treeecfea17ca7089e5419cc2fbd5d24c298432c259c /lib/Sema/SemaType.cpp
parent4fdc1caeb15ae04a216ad725f5a042bbe0036833 (diff)
warn when someone tries to make an array of ObjC interfaces instead of array
of pointers to them. rdar://4304469 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index eafaae5d87..820a1c85f0 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -338,7 +338,11 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S) {
T = Context.IntTy;
D.setInvalidType(true);
}
+ } else if (T->isObjCInterfaceType()) {
+ Diag(DeclType.Loc, diag::warn_objc_array_of_interfaces,
+ T.getAsString());
}
+
// C99 6.7.5.2p1: The size expression shall have integer type.
if (ArraySize && !ArraySize->getType()->isIntegerType()) {
Diag(ArraySize->getLocStart(), diag::err_array_size_non_int,