When recovering from an invalid forward reference to an enum type in C++,
create the enum type in the same scope as you would a record type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90500 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/enum.cpp b/test/SemaCXX/enum.cpp
index db25681..1aba107 100644
--- a/test/SemaCXX/enum.cpp
+++ b/test/SemaCXX/enum.cpp
@@ -25,13 +25,13 @@
/// PR3688
struct s1 {
- enum e1 (*bar)(void); // expected-error{{ISO C++ forbids forward references to 'enum' types}} expected-note{{forward declaration of 'enum s1::e1'}}
+ enum e1 (*bar)(void); // expected-error{{ISO C++ forbids forward references to 'enum' types}}
};
enum e1 { YES, NO };
static enum e1 badfunc(struct s1 *q) {
- return q->bar(); // expected-error{{calling function with incomplete return type 'enum s1::e1'}}
+ return q->bar();
}
enum e2; // expected-error{{ISO C++ forbids forward references to 'enum' types}}