xref: /llvm-project-15.0.7/clang/test/CXX/expr/p3.cpp (revision 8fbe78f6)
1*8fbe78f6SDaniel Dunbar // RUN: %clang_cc1 -fsyntax-only -verify %s
21245e6ffSDouglas Gregor 
31245e6ffSDouglas Gregor double operator +(double, double); // expected-error{{overloaded 'operator+' must have at least one parameter of class or enumeration type}}
41245e6ffSDouglas Gregor 
51245e6ffSDouglas Gregor struct A
61245e6ffSDouglas Gregor {
71245e6ffSDouglas Gregor   operator int();
81245e6ffSDouglas Gregor };
91245e6ffSDouglas Gregor 
101245e6ffSDouglas Gregor int main()
111245e6ffSDouglas Gregor {
121245e6ffSDouglas Gregor   A a, b;
131245e6ffSDouglas Gregor   int i0 = a + 1;
141245e6ffSDouglas Gregor   int i1 = a + b;
151245e6ffSDouglas Gregor }
16