Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 254355 | Differences between
and this patch

Collapse All | Expand All

(-)gcc/c-decl.c.jj (-8 / +13 lines)
Lines 779-792 Link Here
779
	      error ("nested function %q+D declared but never defined", p);
779
	      error ("nested function %q+D declared but never defined", p);
780
	      undef_nested_function = true;
780
	      undef_nested_function = true;
781
	    }
781
	    }
782
	  /* C99 6.7.4p6: "a function with external linkage... declared
782
	     }
783
	     with an inline function specifier ... shall also be defined in the
783
 	  else if (DECL_DECLARED_INLINE_P (p)
784
	     same translation unit."  */
784
 		   && TREE_PUBLIC (p)
785
	  else if (DECL_DECLARED_INLINE_P (p)
785
		   && !DECL_INITIAL (p))
786
		   && TREE_PUBLIC (p)
786
	    {
787
		   && !DECL_INITIAL (p)
787
	      /* C99 6.7.4p6: "a function with external linkage... declared
788
		   && !flag_gnu89_inline)
788
		 with an inline function specifier ... shall also be defined
789
	    pedwarn ("inline function %q+D declared but never defined", p);
789
		 in the same translation unit."  */
790
	      if (!flag_gnu89_inline)
791
		pedwarn ("inline function %q+D declared but never defined", p);
792
	      if (!DECL_EXTERNAL (p))
793
		DECL_EXTERNAL (p) = 1;
794
	    }
790
795
791
	  goto common_symbol;
796
	  goto common_symbol;
792
797
(-)gcc/testsuite/gcc.target/i386/pr39013-1.c.jj (+15 lines)
Line 0 Link Here
1
/* PR target/39013 */
2
/* { dg-do compile { target *-*-linux* } } */
3
/* { dg-options "-O2 -fpie -std=gnu89" } */
4
5
inline int foo (void);
6
extern inline int bar (void);
7
8
int
9
main (void)
10
{
11
  return foo () + bar ();
12
}
13
14
/* { dg-final { scan-assembler "foo@PLT" } } */
15
/* { dg-final { scan-assembler "bar@PLT" } } */
(-)gcc/testsuite/gcc.target/i386/pr39013-2.c.jj (+15 lines)
Line 0 Link Here
1
/* PR target/39013 */
2
/* { dg-do compile { target *-*-linux* } } */
3
/* { dg-options "-O2 -fpie -std=gnu99" } */
4
5
inline int foo (void);		/* { dg-warning "declared but never defined" } */
6
extern inline int bar (void);	/* { dg-warning "declared but never defined" } */
7
8
int
9
main (void)
10
{
11
  return foo () + bar ();
12
}
13
14
/* { dg-final { scan-assembler "foo@PLT" } } */
15
/* { dg-final { scan-assembler "bar@PLT" } } */

Return to bug 254355