diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-29 23:19:07 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-29 23:19:07 +0000 |
commit | c55e294338dfc6dfeac5b73556c763f9e47cab35 (patch) | |
tree | 851070f24a1e8ac4d3680a5d4b7ec7cfc67ec58b /gcc/c-typeck.c | |
parent | b2b0169b21d4ca2efac3fe1811aa9e8499ec6030 (diff) | |
download | ppe42-gcc-c55e294338dfc6dfeac5b73556c763f9e47cab35.tar.gz ppe42-gcc-c55e294338dfc6dfeac5b73556c763f9e47cab35.zip |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131945 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r-- | gcc/c-typeck.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index fb2e47f0969..60b0b02fc04 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -1,6 +1,6 @@ /* Build expressions with type checking for C compiler. Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GCC. @@ -2234,7 +2234,8 @@ build_external_ref (tree id, int fun, location_t loc) && DECL_EXTERNAL (current_function_decl) && VAR_OR_FUNCTION_DECL_P (ref) && (TREE_CODE (ref) != VAR_DECL || TREE_STATIC (ref)) - && ! TREE_PUBLIC (ref)) + && ! TREE_PUBLIC (ref) + && DECL_CONTEXT (ref) != current_function_decl) pedwarn ("%H%qD is static but used in inline function %qD " "which is not static", &loc, ref, current_function_decl); |