int main() { plainFunction(); externFunction(); privateExternFunction(); staticFunction(); return 0; }
inline int useStaticAgain () { // expected-note 2 {{use 'static' to give inline function 'useStaticAgain' internal linkage}} staticFunction(); // expected-warning{{static function 'staticFunction' is used in an inline function with external linkage}} return staticVar; // expected-warning{{static variable 'staticVar' is used in an inline function with external linkage}} }
inline int useStaticMainFile () { staticFunction(); // no-warning return staticVar; // no-warning }
static inline int useStaticFromStatic () { staticFunction(); // no-warning return staticVar; // no-warning }
extern inline int useStaticFromExtern () { // no suggestions staticFunction(); // expected-warning{{static function 'staticFunction' is used in an inline function with external linkage}} return staticVar; // expected-warning{{static variable 'staticVar' is used in an inline function with external linkage}} }
inline int useStatic () { // expected-note 3 {{use 'static' to give inline function 'useStatic' internal linkage}} staticFunction(); // expected-warning{{static function 'staticFunction' is used in an inline function with external linkage}} (void)staticStruct.x; // expected-warning{{static variable 'staticStruct' is used in an inline function with external linkage}} return staticVar; // expected-warning{{static variable 'staticVar' is used in an inline function with external linkage}} }
inline int useStaticMainFileAfterLineMarker() { staticFunction(); // no-warning return staticVar; // no-warning }