2007-11-06 14:07:26 +08:00
|
|
|
// RUN: clang %s -verify -fsyntax-only
|
|
|
|
|
|
|
|
void foo(void);
|
2008-01-15 04:51:29 +08:00
|
|
|
void foo(void) {}
|
2007-11-06 14:07:26 +08:00
|
|
|
void foo(void);
|
2008-11-24 07:12:31 +08:00
|
|
|
void foo(void); // expected-note {{previous declaration is here}}
|
2007-11-06 14:07:26 +08:00
|
|
|
|
2008-01-16 23:01:34 +08:00
|
|
|
void foo(int); // expected-error {{conflicting types for 'foo'}}
|
2008-01-15 04:51:29 +08:00
|
|
|
|
|
|
|
int funcdef()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int funcdef();
|
|
|
|
|
2008-11-24 07:12:31 +08:00
|
|
|
int funcdef2() { return 0; } // expected-note {{previous definition is here}}
|
2008-01-15 04:51:29 +08:00
|
|
|
int funcdef2() { return 0; } // expected-error {{redefinition of 'funcdef2'}}
|
|
|
|
|
2009-01-28 08:44:33 +08:00
|
|
|
// PR2502
|
|
|
|
void (*f)(void);
|
|
|
|
void (*f)() = 0;
|
2009-01-29 05:22:12 +08:00
|
|
|
|
|
|
|
typedef __attribute__(( ext_vector_type(2) )) int Vi2;
|
|
|
|
typedef __attribute__(( ext_vector_type(2) )) float Vf2;
|
|
|
|
|
|
|
|
Vf2 g0; // expected-note {{previous definition is here}}
|
|
|
|
Vi2 g0; // expected-error {{redefinition of 'g0'}}
|
|
|
|
|
|
|
|
_Complex int g1; // expected-note {{previous definition is here}}
|
|
|
|
_Complex float g1; // expected-error {{redefinition of 'g1'}}
|