p1.cpp revision 5f8d604246976a93a73549b07bbc8ee0b2061b50
1// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s
2
3namespace test0 {
4  struct A {
5    A() = default;
6    int x;
7    int y;
8
9    A(const A&) = delete; // expected-note {{function has been explicitly marked deleted here}}
10  };
11
12  void foo(...);
13
14  void test() {
15    A a;
16    foo(a); // expected-error {{call to deleted constructor of 'test0::A'}}
17  }
18}
19
20namespace test1 {
21  struct A {
22    A() = default;
23    int x;
24    int y;
25
26  private:
27    A(const A&) = default; // expected-note {{declared private here}}
28  };
29
30  void foo(...);
31
32  void test() {
33    A a;
34    // FIXME: this error about variadics is bogus
35    foo(a); // expected-error {{calling a private constructor of class 'test1::A'}} expected-error {{cannot pass object of non-trivial type 'test1::A' through variadic function}}
36  }
37}
38