diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2010-08-19 04:39:37 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2010-08-19 04:39:37 +0000 |
commit | 34fd628d22f54baddf30cf80c401b2f862a31b23 (patch) | |
tree | 4d2bb914eb0047c49b2fea6ffdf9dead74d40334 /test/Sema/enum.c | |
parent | a2fc0f54d69461795433d42c46de337850be15cd (diff) |
Fix for PR7911 and PR7921: make isIntegralOrEnumerationType return false
for incomplete enum types. An incomplete enum can't really be treated as
an "integral or enumeration" type, and the incorrect treatment leads to
bad behavior for many callers.
This makes isIntegralOrEnumerationType equivalent to isIntegerType; I think
we should globally replace the latter with the former; thoughts?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/enum.c')
-rw-r--r-- | test/Sema/enum.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Sema/enum.c b/test/Sema/enum.c index 057015011e..64aa31bc4b 100644 --- a/test/Sema/enum.c +++ b/test/Sema/enum.c @@ -96,3 +96,9 @@ char * s = (an_enum) an_enumerator; // expected-warning {{incompatible integer t // PR4515 enum PR4515 {PR4515a=1u,PR4515b=(PR4515a-2)/2}; int CheckPR4515[PR4515b==0?1:-1]; + +// PR7911 +extern enum PR7911T PR7911V; // expected-warning{{ISO C forbids forward references to 'enum' types}} +void PR7911F() { + switch (PR7911V); // expected-error {{statement requires expression of integer type}} +} |