diff options
Diffstat (limited to 'test/SemaCXX/direct-initializer.cpp')
-rw-r--r-- | test/SemaCXX/direct-initializer.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaCXX/direct-initializer.cpp b/test/SemaCXX/direct-initializer.cpp index 149b65c8d71d3..a9e2b2bb6e456 100644 --- a/test/SemaCXX/direct-initializer.cpp +++ b/test/SemaCXX/direct-initializer.cpp @@ -34,3 +34,17 @@ void g() { Z z; // expected-error{{no matching constructor for initialization of 'z'}} } + +struct Base { + operator int*() const; +}; + +struct Derived : Base { + operator int*(); +}; + +void foo(const Derived cd, Derived d) { + int *pi = cd; // expected-error {{incompatible type initializing 'struct Derived const', expected 'int *'}} + int *ppi = d; + +} |