PR8023: Don't crash on invalid uses of __real__ on class types in C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113124 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/unary-real-imag.cpp b/test/SemaCXX/unary-real-imag.cpp
new file mode 100644
index 0000000..91b63e3
--- /dev/null
+++ b/test/SemaCXX/unary-real-imag.cpp
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct A {};
+int i = __real__ A(); // expected-error {{invalid type 'A' to __real operator}}
+int j = __imag__ A(); // expected-error {{invalid type 'A' to __imag operator}}
+