diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/SemaObjC/enum-fixed-type.m | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/SemaObjC/enum-fixed-type.m')
-rw-r--r-- | test/SemaObjC/enum-fixed-type.m | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/SemaObjC/enum-fixed-type.m b/test/SemaObjC/enum-fixed-type.m index 4fe643f..c00e45a 100644 --- a/test/SemaObjC/enum-fixed-type.m +++ b/test/SemaObjC/enum-fixed-type.m @@ -1,5 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -// expected-no-diagnostics +// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s #if !__has_feature(objc_fixed_enum) # error Enumerations with a fixed underlying type are not supported @@ -29,10 +28,13 @@ void test() { // <rdar://10381507> typedef enum : long { Foo } IntegerEnum; -int arr[(sizeof(typeof(Foo)) == sizeof(typeof(IntegerEnum))) - 1]; -int arr1[(sizeof(typeof(Foo)) == sizeof(typeof(long))) - 1]; -int arr2[(sizeof(typeof(IntegerEnum)) == sizeof(typeof(long))) - 1]; +int arr[(sizeof(__typeof__(Foo)) == sizeof(__typeof__(IntegerEnum)))? 1 : -1]; +int arr1[(sizeof(__typeof__(Foo)) == sizeof(__typeof__(long)))? 1 : -1]; +int arr2[(sizeof(__typeof__(IntegerEnum)) == sizeof(__typeof__(long)))? 1 : -1]; // <rdar://problem/10760113> typedef enum : long long { Bar = -1 } LongLongEnum; int arr3[(long long)Bar == (long long)-1 ? 1 : -1]; + +typedef enum : Integer { BaseElem } BaseEnum; +typedef enum : BaseEnum { DerivedElem } DerivedEnum; // expected-error {{non-integral type 'BaseEnum' is an invalid underlying type}} |