Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / deleted-operator.cpp
blob64b2b22e5661cb84791e2ceb399ddabbb9cbeeb0
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
3 struct PR10757 {
4 bool operator~() = delete; // expected-note {{explicitly deleted}}
5 bool operator==(const PR10757&) = delete; // expected-note {{explicitly deleted}}
6 operator float();
7 };
8 int PR10757f() {
9 PR10757 a1;
10 // FIXME: We get a ridiculous number of "built-in candidate" notes here...
11 if(~a1) {} // expected-error {{overload resolution selected deleted operator}} expected-note 6-8 {{built-in candidate}}
12 if(a1==a1) {} // expected-error {{overload resolution selected deleted operator}} expected-note 1-144 {{built-in candidate}}
15 struct DelOpDel {
16 // FIXME: In MS ABI, we error twice below.
17 virtual ~DelOpDel() {} // expected-error 1-2 {{attempt to use a deleted function}}
18 void operator delete(void*) = delete; // expected-note 1-2 {{deleted here}}