diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-06 18:34:03 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-06 18:34:03 +0000 |
commit | 80711a22fa06b734a68d719ac85d4e443a51cb09 (patch) | |
tree | 7d1ff807a14a0f0dada1ff41f3db62776c1ef9a1 /test/Sema/enum.c | |
parent | 6370812b4277134b3c5cd143b20adc8c94890b91 (diff) |
Implement the GNU semantics for forward declarations of enum types in
C and C++. Fixes PR3688.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66282 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/enum.c')
-rw-r--r-- | test/Sema/enum.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Sema/enum.c b/test/Sema/enum.c index 55ddb0ddd9..ce49f3064d 100644 --- a/test/Sema/enum.c +++ b/test/Sema/enum.c @@ -73,3 +73,14 @@ typedef enum { X = 0 }; // expected-warning{{typedef requires a name}} enum NotYetComplete { // expected-note{{definition of 'enum NotYetComplete' is not complete until the closing '}'}} NYC1 = sizeof(enum NotYetComplete) // expected-error{{invalid application of 'sizeof' to an incomplete type 'enum NotYetComplete'}} }; + +/// PR3688 +struct s1 { + enum e1 (*bar)(void); // expected-warning{{ISO C forbids forward references to 'enum' types}} +}; + +enum e1 { YES, NO }; + +static enum e1 badfunc(struct s1 *q) { + return q->bar(); +} |