Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / special / class.temporary / p1.cpp
blob208062a7c3cb65991762a42bb8b8e5d06d270e2e
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
3 namespace test0 {
4 struct A {
5 A() = default;
6 int x;
7 int y;
9 A(const A&) = delete; // expected-note {{'A' has been explicitly marked deleted here}}
12 void foo(...);
14 void test() {
15 A a;
16 foo(a); // expected-error {{call to deleted constructor of 'A'}}
20 namespace test1 {
21 struct A {
22 A() = default;
23 int x;
24 int y;
26 private:
27 A(const A&) = default; // expected-note {{declared private here}}
30 void foo(...);
32 void test() {
33 A a;
34 foo(a); // expected-error {{calling a private constructor of class 'test1::A'}}
38 // Don't enforce this in an unevaluated context.
39 namespace test2 {
40 struct A {
41 A(const A&) = delete; // expected-note {{marked deleted here}}
44 typedef char one[1];
45 typedef char two[2];
47 one &meta(bool);
48 two &meta(...);
50 void a(A &a) {
51 char check[sizeof(meta(a)) == 2 ? 1 : -1];
54 void b(A &a) {
55 meta(a); // expected-error {{call to deleted constructor}}