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() { }
|
2011-05-26 09:26:05 +08:00
|
|
|
inline A(A&, int); // expected-note {{was not a special member function}}
|
2010-03-03 02:48:07 +08:00
|
|
|
};
|
|
|
|
|
2011-05-26 09:26:05 +08:00
|
|
|
A::A(A&, int = 0) { } // expected-warning {{makes this constructor a copy constructor}}
|
2010-03-03 02:48:07 +08:00
|
|
|
|
|
|
|
void f() {
|
|
|
|
A const a;
|
|
|
|
A b(a);
|
|
|
|
}
|
|
|
|
}
|