blob: 786d1451e62d15af396f5edb807df2568a7c3a00 [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) { }
Chris Lattner5f4a6822008-11-23 23:12:31 +00008 explicit Foo(int); // expected-note {{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};
Douglas Gregor9d350972008-12-12 08:25:50 +000021
22Foo::Foo(const Foo&) { }
23
Douglas Gregor9e7d9de2008-12-15 21:24:18 +000024typedef struct {
25 int version;
26} Anon;
27extern const Anon anon;
28extern "C" const Anon anon2;
29