diff options
Diffstat (limited to 'test/SemaCXX/converting-constructor.cpp')
-rw-r--r-- | test/SemaCXX/converting-constructor.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/SemaCXX/converting-constructor.cpp b/test/SemaCXX/converting-constructor.cpp new file mode 100644 index 0000000000..4bcd5aa01e --- /dev/null +++ b/test/SemaCXX/converting-constructor.cpp @@ -0,0 +1,23 @@ +// RUN: clang -fsyntax-only %s +class Z { }; + +class Y { +public: + Y(const Z&); +}; + +class X { +public: + X(int); + X(const Y&); +}; + +void f(X); + +void g(short s, Y y, Z z) { + f(s); + f(1.0f); + f(y); + f(z); // expected-error{{incompatible}} +} + |