1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
5 operator char *(); // expected-note {{conversion to pointer type}}
9 operator int *(); // expected-note {{conversion to pointer type}}
14 delete d
; // expected-error {{ambiguous conversion of delete expression of type 'D' to a pointer}}
33 operator const int *(); // expected-note {{conversion to pointer type}}
37 operator int *(); // expected-note {{conversion to pointer type}}
42 delete d
; // expected-error {{ambiguous conversion of delete expression of type 'D2' to a pointer}}
47 operator const int *(); // expected-note {{conversion to pointer type}}
51 operator const int *(); // expected-note {{conversion to pointer type}}
59 delete d
; // expected-error {{ambiguous conversion of delete expression of type 'D3' to a pointer}}
68 void f4(X x
) { delete x
; delete x
; }
74 template<typename T
> operator T
*() const; // converts to any pointer!
77 void f5(X1 x
) { delete x
; } // OK. In selecting a conversion to pointer function, template convesions are skipped.
84 struct Derived
: Base
{
85 // not the same function as Base's non-const operator int()
86 operator int*() const;
89 void foo6(const Derived cd
, Derived d
) {
90 // overload resolution selects Derived::operator int*() const;
97 template<typename T
> operator T
*() const;
101 template<typename T
> operator T
*() const; // hides base conversion
102 operator int *() const;
107 // OK. In selecting a conversion to pointer function, template convesions are skipped.