Don't perform integral promotions from an incompletion enumeration
type. Fixes PR8089 in a slightly different way than had been suggested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113711 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/enum.cpp b/test/SemaCXX/enum.cpp
index 1dc55e3..b4a050c 100644
--- a/test/SemaCXX/enum.cpp
+++ b/test/SemaCXX/enum.cpp
@@ -90,3 +90,8 @@
 enum PR7921E {
     PR7921V = (PR7921E)(123) // expected-error {{expression is not an integer constant expression}}
 };
+
+void PR8089() {
+  enum E; // expected-error{{ISO C++ forbids forward references to 'enum' types}}
+  int a = (E)3; // expected-error{{cannot initialize a variable of type 'int' with an rvalue of type 'E'}}
+}