From 1033ffa8b312170efeeef1f3e4f58ced8075eaea Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 30 Jan 2008 00:19:07 +0100 Subject: re PR c/35017 (PR11377 pedwarns even about valid code) PR c/35017 * c-decl.c (start_decl): Don't pedwarn about TREE_READONLY static decls. * c-typeck.c (build_external_ref): Don't pedwarn about static vars in current function's scope. * gcc.dg/inline-25.c: New test. * gcc.dg/inline-26.c: New test. * gcc.dg/inline-27.c: New test. From-SVN: r131945 --- gcc/c-decl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/c-decl.c') diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 860b337..1af84da 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3320,6 +3320,7 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs, if (TREE_CODE (decl) == VAR_DECL && current_scope != file_scope && TREE_STATIC (decl) + && !TREE_READONLY (decl) && DECL_DECLARED_INLINE_P (current_function_decl) && DECL_EXTERNAL (current_function_decl)) pedwarn ("%q+D is static but declared in inline function %qD " -- cgit v1.1