1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -Wretained-language-linkage -DW_RETAINED_LANGUAGE_LINKAGE %s
4 extern "C" void f(int);
8 extern "C++" int& g(int);
13 void test(int x
, double d
) {
23 extern "C" const int bar
;
24 extern "C" int const bar
;
26 extern "C" struct bar d
;
32 int foo(int x
) { return x
; }
39 extern "C" void func(void);
41 using namespace pr5430
;
42 extern "C" void pr5430::func(void) { }
65 return f2b((char *)0); // ok
71 extern "C" typedef int (*PutcFunc_t
)(int);
75 extern "C" void pr7859_a(int) {} // expected-note {{previous definition}}
76 extern "C" void pr7859_a(int) {} // expected-error {{redefinition}}
78 extern "C" void pr7859_b() {} // expected-note {{previous definition}}
79 extern "C" void pr7859_b(int) {} // expected-error {{conflicting}}
81 extern "C" void pr7859_c(short) {} // expected-note {{previous definition}}
82 extern "C" void pr7859_c(int) {} // expected-error {{conflicting}}
93 extern "C++" template <class T
> int pr7754(T param
);
99 extern "C++" using N::value
;
102 extern "C" const char *Version_string
= "2.9";
105 extern const char *Version_string2
= "2.9";
110 typedef struct _ArtsSink ArtsSink
;
115 int arts_sink_get_type()
117 return sizeof(ArtsSink
);
122 namespace js
{ extern int ObjectClass
; }
129 extern "C" void PR16167
; // expected-error {{variable has incomplete type 'void'}}
130 extern void PR16167_0
; // expected-error {{variable has incomplete type 'void'}}
137 extern "C" void f_pr7927(int);
140 extern "C" void f_pr7927(int);
160 extern "C" int bar3(Foo
*y
);
163 friend int bar3(Foo
*y
);
164 #ifdef W_RETAINED_LANGUAGE_LINKAGE
165 // expected-note@-5 {{previous declaration is here}}
166 // expected-warning@-3 {{retaining previous language linkage}}
169 extern "C" int bar3(Foo
*y
) {