2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2009-08-07 01:22:51 +08:00
|
|
|
|
2009-12-23 06:17:25 +08:00
|
|
|
struct S {
|
|
|
|
S (S); // expected-error {{copy constructor must pass its first argument by reference}}
|
2009-08-07 01:22:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
S f();
|
|
|
|
|
|
|
|
void g() {
|
2009-12-23 06:17:25 +08:00
|
|
|
S a( f() );
|
2009-08-07 01:22:51 +08:00
|
|
|
}
|
2009-11-14 07:59:09 +08:00
|
|
|
|
2010-03-03 02:48:07 +08:00
|
|
|
namespace PR6064 {
|
|
|
|
struct A {
|
|
|
|
A() { }
|
|
|
|
inline A(A&, int);
|
|
|
|
};
|
|
|
|
|
|
|
|
A::A(A&, int = 0) { }
|
|
|
|
|
|
|
|
void f() {
|
|
|
|
A const a;
|
|
|
|
A b(a);
|
|
|
|
}
|
|
|
|
}
|