| // RUN: clang-cc -fsyntax-only -verify -std=c++0x %s |
| operator char *(); // expected-note {{candidate function}} |
| operator int *(); // expected-note {{candidate function}} |
| delete d; // expected-error {{ambiguous conversion of delete expression of type 'struct D' to a pointer}} |
| operator const int *(); // expected-note {{candidate function}} |
| operator int *(); // expected-note {{candidate function}} |
| delete d; // expected-error {{ambiguous conversion of delete expression of type 'struct D2' to a pointer}} |
| operator const int *(); // expected-note {{candidate function}} |
| operator const int *(); // expected-note {{candidate function}} |
| delete d; // expected-error {{mbiguous conversion of delete expression of type 'struct D3' to a pointer}} |
| void f4(X x) { delete x; delete x; } |
| template<typename T> operator T*() const; // converts to any pointer! |
| void f5(X1 x) { delete x; } // OK. In selecting a conversion to pointer function, template convesions are skipped. |
| // not the same function as Base's non-const operator int() |
| void foo6(const Derived cd, Derived d) { |
| // overload resolution selects Derived::operator int*() const; |
| template<typename T> operator T*() const; |
| template<typename T> operator T*() const; // hides base conversion |
| // OK. In selecting a conversion to pointer function, template convesions are skipped. |