1 // PR c++/51079 2 3 #if __cplusplus > 199711L 4 struct C1 5 { 6 template <class T> 7 operator T() = delete; // { dg-message "declared here" "" { target c++11 } } 8 operator bool() { return false; } 9 } c1; 10 11 int ic1 = c1; // { dg-error "deleted" "" { target c++11 } } 12 int ac1 = c1 + c1; // { dg-error "deleted" "" { target c++11 } } 13 #endif 14 15 struct C2 16 { 17 private: 18 template <class T> 19 operator T(); // { dg-message "private" } 20 public: 21 operator bool() { return false; } 22 } c2; 23 24 int ic2 = c2; // { dg-error "" } 25 int ac2 = c2 + c2; // { dg-error "" } 26