From 4bf437ecd8ccd86d154b16521b8406246aa33e3a Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 22 Aug 2014 23:17:52 +0000 Subject: 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 --- clang/test/SemaObjC/encode-typeof-test.m | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'clang/test/SemaObjC') diff --git a/clang/test/SemaObjC/encode-typeof-test.m b/clang/test/SemaObjC/encode-typeof-test.m index 2cda9739681..fe8f29c3b97 100644 --- a/clang/test/SemaObjC/encode-typeof-test.m +++ b/clang/test/SemaObjC/encode-typeof-test.m @@ -24,3 +24,22 @@ int main() int i; typeof(@encode(typeof(i))) e = @encode(typeof(Intf)); // expected-warning {{initializer-string for char array is too long}} } + +// rdar://9255564 +typedef short short8 __attribute__((ext_vector_type(8))); + +struct foo { + char a; + int b; + long c; + short8 d; + int array[4]; + short int bitfield1:5; + unsigned short bitfield2:11; + char *string; +}; + +const char *RetEncode () { + return @encode(struct foo); // expected-warning {{encoding of 'struct foo' type is incomplete because 'short8' (vector of 8 'short' values) component has unknown encoding}} +} + -- cgit v1.2.3