summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-08-22 23:17:52 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-08-22 23:17:52 +0000
commit4bf437ecd8ccd86d154b16521b8406246aa33e3a (patch)
treefcafabf0386374db0d400d89d65628579964be75 /clang/lib/Sema
parente82d89cc37ceb69bcb35b911e2ca2119aa51a5e5 (diff)
downloadbcm5719-llvm-4bf437ecd8ccd86d154b16521b8406246aa33e3a.tar.gz
bcm5719-llvm-4bf437ecd8ccd86d154b16521b8406246aa33e3a.zip
Objective-C. Warn when @encode'ing provides an incomplete
type encoding because in certain cases, such as for vector types, because we still haven't designed encoding for them. rdar://9255564 llvm-svn: 216301
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaExprObjC.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp
index 22c55a7726f..7ade45d4929 100644
--- a/clang/lib/Sema/SemaExprObjC.cpp
+++ b/clang/lib/Sema/SemaExprObjC.cpp
@@ -995,7 +995,11 @@ ExprResult Sema::BuildObjCEncodeExpression(SourceLocation AtLoc,
return ExprError();
std::string Str;
- Context.getObjCEncodingForType(EncodedType, Str);
+ QualType NotEncodedT;
+ Context.getObjCEncodingForType(EncodedType, Str, nullptr, &NotEncodedT);
+ if (!NotEncodedT.isNull())
+ Diag(AtLoc, diag::warn_incomplete_encoded_type)
+ << EncodedType << NotEncodedT;
// The type of @encode is the same as the type of the corresponding string,
// which is an array type.
OpenPOWER on IntegriCloud