blob: b211cb1fe004a052056fdcbb11e545ce12f1329d [file] [log] [blame]
Alexis Hunt61bc1732011-05-01 07:04:31 +00001// RUN: %clang_cc1 -fsyntax-only -std=c++0x -verify %s
2
3struct foo {
4 int i;
5 foo();
6 foo(int);
7 foo(int, int);
8 foo(bool);
9 foo(char);
10 foo(float*);
11 foo(float&);
12};
13
14// Good
15foo::foo (int i) : i(i) {
16}
17// Good
18foo::foo () : foo(-1) {
19}
20// Good
21foo::foo (int, int) : foo() {
22}
23
24foo::foo (bool) : foo(true) { // expected-error{{delegates to itself}}
25}
26
27// Good
28foo::foo (float* f) : foo(*f) {
29}
30
31// FIXME: This should error
32foo::foo (float &f) : foo(&f) {
33}
34
35foo::foo (char) : i(3), foo(3) { // expected-error{{must appear alone}}
36}