blob: 9809bfc84bbf8c702499327756edd19c08f0f811 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Fariborz Jahanian52ab92b2009-08-06 17:22:51 +00002
Douglas Gregor90f93822009-12-22 22:17:25 +00003struct S {
4 S (S); // expected-error {{copy constructor must pass its first argument by reference}}
Fariborz Jahanian52ab92b2009-08-06 17:22:51 +00005};
6
7S f();
8
9void g() {
Douglas Gregor90f93822009-12-22 22:17:25 +000010 S a( f() );
Fariborz Jahanian52ab92b2009-08-06 17:22:51 +000011}
Douglas Gregorfd476482009-11-13 23:59:09 +000012
Douglas Gregor2366cd52010-03-02 18:48:07 +000013namespace PR6064 {
14 struct A {
15 A() { }
16 inline A(A&, int);
17 };
18
19 A::A(A&, int = 0) { }
20
21 void f() {
22 A const a;
23 A b(a);
24 }
25}