Fix a crash-on-invalid where the constant evaluator would try to
evaluate certain expressions involving invalidly-defined classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155645 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/constant-expression.cpp b/test/SemaCXX/constant-expression.cpp
index 23a4dda..c997f3c 100644
--- a/test/SemaCXX/constant-expression.cpp
+++ b/test/SemaCXX/constant-expression.cpp
@@ -117,3 +117,10 @@
   typedef int a[(int)42.997];
   typedef int b[(int)4e10]; // expected-warning {{variable length}} expected-error {{variable length}}
 }
+
+// PR12626
+namespace test3 {
+  struct X; // expected-note {{forward declaration of 'test3::X'}}
+  struct Y { bool b; X x; }; // expected-error {{field has incomplete type 'test3::X'}}
+  int f() { return Y().b; }
+}