Implement the GNU semantics for forward declarations of enum types in
C and C++. Fixes PR3688.

llvm-svn: 66282
diff --git a/clang/test/Sema/enum.c b/clang/test/Sema/enum.c
index 55ddb0d..ce49f30 100644
--- a/clang/test/Sema/enum.c
+++ b/clang/test/Sema/enum.c
@@ -73,3 +73,14 @@
 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();
+}