UnaryOperatorKind Opc,
Expr *Input) {
if (getLangOptions().CPlusPlus && Input->getType()->isOverloadableType() &&
- Opc != UO_Extension) {
+ UnaryOperator::getOverloadedOperator(Opc) != OO_None) {
// Find all of the overloaded operators visible from this
// point. We perform both an operator-name lookup from the local
// scope and an argument-dependent lookup based on the types of
--- /dev/null
+// 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}}
+