Douglas Gregor | b48fe38 | 2008-10-31 09:07:45 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
Douglas Gregor | 030ff0c | 2008-10-31 20:25:05 +0000 | [diff] [blame] | 3 | typedef int INT; |
| 4 | |
Douglas Gregor | b48fe38 | 2008-10-31 09:07:45 +0000 | [diff] [blame] | 5 | class Foo { |
| 6 | Foo(); |
| 7 | (Foo)(float) { } |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame^] | 8 | explicit Foo(int); // expected-note {{previous declaration is here}} |
Douglas Gregor | b48fe38 | 2008-10-31 09:07:45 +0000 | [diff] [blame] | 9 | Foo(const Foo&); |
| 10 | |
Douglas Gregor | 030ff0c | 2008-10-31 20:25:05 +0000 | [diff] [blame] | 11 | ((Foo))(INT); // expected-error{{cannot be redeclared}} |
| 12 | |
| 13 | Foo(Foo foo, int i = 17, int j = 42); // expected-error {{copy constructor must pass its first argument by reference}} |
| 14 | |
Douglas Gregor | b48fe38 | 2008-10-31 09:07:45 +0000 | [diff] [blame] | 15 | static Foo(short, short); // expected-error{{constructor cannot be declared 'static'}} |
| 16 | virtual Foo(double); // expected-error{{constructor cannot be declared 'virtual'}} |
| 17 | Foo(long) const; // expected-error{{'const' qualifier is not allowed on a constructor}} |
| 18 | |
| 19 | int Foo(int, int); // expected-error{{constructor cannot have a return type}} |
| 20 | }; |