blob: 0d3cce36bdc5d7448a7922e3c7902f315821c4af [file] [log] [blame]
Chris Lattner1470b072007-11-06 06:07:26 +00001// RUN: clang %s -verify -fsyntax-only
2
3void foo(void);
Steve Naroff1d5bd642008-01-14 20:51:29 +00004void foo(void) {}
Chris Lattner1470b072007-11-06 06:07:26 +00005void foo(void);
Chris Lattner1336cab2008-11-23 23:12:31 +00006void foo(void); // expected-note {{previous declaration is here}}
Chris Lattner1470b072007-11-06 06:07:26 +00007
Steve Naroff6c9e7922008-01-16 15:01:34 +00008void foo(int); // expected-error {{conflicting types for 'foo'}}
Steve Naroff1d5bd642008-01-14 20:51:29 +00009
10int funcdef()
11{
12 return 0;
13}
14
15int funcdef();
16
Chris Lattner1336cab2008-11-23 23:12:31 +000017int funcdef2() { return 0; } // expected-note {{previous definition is here}}
Steve Naroff1d5bd642008-01-14 20:51:29 +000018int funcdef2() { return 0; } // expected-error {{redefinition of 'funcdef2'}}
19
Nuno Lopese1726fd2009-01-28 00:44:33 +000020// PR2502
21void (*f)(void);
22void (*f)() = 0;