blob: 1aedb29c4e0b41a08ca4811a2c4eb6569d476b36 [file] [log] [blame]
Douglas Gregorb48fe382008-10-31 09:07:45 +00001// RUN: clang -fsyntax-only -verify %s
2
Douglas Gregor030ff0c2008-10-31 20:25:05 +00003typedef int INT;
4
Douglas Gregorb48fe382008-10-31 09:07:45 +00005class Foo {
6 Foo();
7 (Foo)(float) { }
Douglas Gregor030ff0c2008-10-31 20:25:05 +00008 explicit Foo(int); // expected-error{{previous declaration is here}}
Douglas Gregorb48fe382008-10-31 09:07:45 +00009 Foo(const Foo&);
10
Douglas Gregor030ff0c2008-10-31 20:25:05 +000011 ((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 Gregorb48fe382008-10-31 09:07:45 +000015 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};