diff options
Diffstat (limited to 'clang/test/CXX/expr/p3.cpp')
-rw-r--r-- | clang/test/CXX/expr/p3.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CXX/expr/p3.cpp b/clang/test/CXX/expr/p3.cpp new file mode 100644 index 0000000..6b243c2 --- /dev/null +++ b/clang/test/CXX/expr/p3.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +double operator +(double, double); // expected-error{{overloaded 'operator+' must have at least one parameter of class or enumeration type}} + +struct A +{ + operator int(); +}; + +int main() +{ + A a, b; + int i0 = a + 1; + int i1 = a + b; +} |