aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/enum.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-01-16 23:54:22 +0000
committerSteve Naroff <snaroff@apple.com>2008-01-16 23:54:22 +0000
commit67c49e892b50a9ccb64f7296e00c23c61a8b7186 (patch)
treeb45ac6b2a5b11cd219ced55c68558f93f436c1fd /test/Sema/enum.c
parente3d7c24f282e061ca9dd9268127ca9a24d715ccf (diff)
Type::isArithmeticType(): disallow incomplete enum decls.
Bug submitted by Eli. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46102 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/enum.c')
-rw-r--r--test/Sema/enum.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Sema/enum.c b/test/Sema/enum.c
index 79a92c8f2d..169c394c50 100644
--- a/test/Sema/enum.c
+++ b/test/Sema/enum.c
@@ -22,3 +22,9 @@ int test() {
return sizeof(enum e) ;
}
+enum gccForwardEnumExtension ve; // expected-warning {{ISO C forbids forward references to 'enum' types}}
+
+int test2(int i)
+{
+ ve + i; // expected-error{{invalid operands to binary expression ('enum gccForwardEnumExtension' and 'int')}}
+}