1 // RUN: %clang_cc1 -Wreturn-type -fsyntax-only -std=c++11 -verify %s
18 virtual void B() {} // Can only do this in C++11
27 extern "C" U
f3( void ); // expected-warning {{'f3' has C-linkage specified, but returns user-defined type 'U' which is incompatible with C}}
28 extern "C" S
f0(void); // expected-warning {{'f0' has C-linkage specified, but returns user-defined type 'S' which is incompatible with C}}
29 extern "C" A
f4( void ); // expected-warning {{'f4' has C-linkage specified, but returns user-defined type 'A' which is incompatible with C}}
31 // These should all be fine
32 extern "C" S2
f5( void );
33 extern "C" void f2( A x
);
34 extern "C" void f6( S s
);
35 extern "C" void f7( U u
);
36 extern "C" double f8(void);
37 extern "C" long long f11( void );
38 extern "C" A
*f10( void );
40 extern "C" struct mypodstruct
f12(); // expected-warning {{'f12' has C-linkage specified, but returns incomplete type 'struct mypodstruct' which could be incompatible with C}}
43 // FIXME: we should probably suppress the first warning as the second one
45 // For now this tests that a second 'extern "C"' is not necessary to trigger
48 extern "C" A
f(void); // expected-warning {{'f' has C-linkage specified, but returns incomplete type 'A' which could be incompatible with C}}
52 A
f(void); // no warning. warning is already issued on first declaration.
60 // Don't warn for static functions.
66 namespace rdar13364028
{
73 #pragma clang diagnostic push
74 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
76 #pragma clang diagnostic pop
77 A
bbb(); // expected-warning {{'bbb' has C-linkage specified, but returns user-defined type 'A' which is incompatible with C}}
78 A
ccc() { // expected-warning {{'ccc' has C-linkage specified, but returns user-defined type 'A' which is incompatible with C}}