aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-05 22:45:59 +0000
committerChris Lattner <sabre@nondot.org>2009-03-05 22:45:59 +0000
commit247936605913c718f4141f845aec6cb6e169fb37 (patch)
tree446b6c874793d4aee7fa9edd9b0967e295b56764 /test
parentd61a50a84d87a317cf929c6c1babf27d404b1e29 (diff)
fix PR3607 and a fixme, by checking bitfield constraints
more consistently. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Sema/bitfield.c7
-rw-r--r--test/SemaCXX/class.cpp4
2 files changed, 9 insertions, 2 deletions
diff --git a/test/Sema/bitfield.c b/test/Sema/bitfield.c
index f3b285b12e..2e4df47650 100644
--- a/test/Sema/bitfield.c
+++ b/test/Sema/bitfield.c
@@ -1,4 +1,5 @@
// RUN: clang %s -fsyntax-only -verify
+enum e0;
struct a {
int a : -1; // expected-error{{bit-field 'a' has negative width}}
@@ -11,4 +12,10 @@ struct a {
// rdar://6138816
int e : 0; // expected-error {{bit-field 'e' has zero width}}
+
+ float xx : 4; // expected-error {{bit-field 'xx' has non-integral type}}
+
+ // PR3607
+ enum e0 f : 1; // expected-error {{field has incomplete type 'enum e0'}}
};
+
diff --git a/test/SemaCXX/class.cpp b/test/SemaCXX/class.cpp
index 02608faa0f..08391c9ba1 100644
--- a/test/SemaCXX/class.cpp
+++ b/test/SemaCXX/class.cpp
@@ -27,8 +27,8 @@ public:
typedef int func();
func tm;
func *ptm;
- func btm : 1; // expected-error {{error: bit-field 'btm' with non-integral type}}
- NestedC bc : 1; // expected-error {{error: bit-field 'bc' with non-integral type}}
+ func btm : 1; // expected-error {{error: bit-field 'btm' has non-integral type}}
+ NestedC bc : 1; // expected-error {{error: bit-field 'bc' has non-integral type}}
enum E1 { en1, en2 };