re PR c/63453 (Bogus warning for gnu_inline functions)

PR c/63453
	* c-decl.c (pop_scope): Don't warn about "inline function declared
	but never defined" for functions marked with gnu_inline attribute.

	* gcc.dg/pr63453.c: New test.

From-SVN: r215874
This commit is contained in:
Marek Polacek 2014-10-03 20:14:48 +00:00 committed by Marek Polacek
parent 0ccaaab0e3
commit 6bc8a1261f
4 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2014-10-03 Marek Polacek <polacek@redhat.com>
PR c/63453
* c-decl.c (pop_scope): Don't warn about "inline function declared
but never defined" for functions marked with gnu_inline attribute.
2014-09-25 Jakub Jelinek <jakub@redhat.com>
PR c++/63249

View File

@ -1177,7 +1177,8 @@ pop_scope (void)
/* C99 6.7.4p6: "a function with external linkage... declared
with an inline function specifier ... shall also be defined
in the same translation unit." */
if (!flag_gnu89_inline)
if (!flag_gnu89_inline
&& !lookup_attribute ("gnu_inline", DECL_ATTRIBUTES (p)))
pedwarn (input_location, 0,
"inline function %q+D declared but never defined", p);
DECL_EXTERNAL (p) = 1;

View File

@ -1,3 +1,8 @@
2014-10-03 Marek Polacek <polacek@redhat.com>
PR c/63453
* gcc.dg/pr63453.c: New test.
2014-10-03 Marc Glisse <marc.glisse@inria.fr>
PR c++/54427

View File

@ -0,0 +1,8 @@
/* PR c/63453 */
/* { dg-do compile } */
/* { dg-options "-std=gnu11" } */
inline int fn1 (void); /* { dg-warning "declared but never defined" } */
extern inline int fn2 (void); /* { dg-warning "declared but never defined" } */
inline int __attribute__ ((gnu_inline)) fn3 (void);
extern inline int __attribute__ ((gnu_inline)) fn4 (void);