aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2014-10-23 16:46:44 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2014-10-23 16:46:44 +0000
commit1bc5a4513e09efd42f22ccbc25ff8cd7ec5619f5 (patch)
treefdeee113cb53fa81f984ce5e2e06f99d5f908461 /gcc
parent59d7607aec61d173914f2af06097cd46d10d3504 (diff)
downloadgcc-1bc5a4513e09efd42f22ccbc25ff8cd7ec5619f5.zip
gcc-1bc5a4513e09efd42f22ccbc25ff8cd7ec5619f5.tar.gz
gcc-1bc5a4513e09efd42f22ccbc25ff8cd7ec5619f5.tar.bz2
re PR c/63626 (Warning "inline function declared but never defined" output twice)
PR c/63626 * c-decl.c (pop_scope): Don't print warning in external_scope. * gcc.dg/pr63626.c: New test. From-SVN: r216595
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c/ChangeLog5
-rw-r--r--gcc/c/c-decl.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr63626.c8
4 files changed, 20 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 397bf28..9b6c1d5 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,8 @@
+2014-10-23 Marek Polacek <polacek@redhat.com>
+
+ PR c/63626
+ * c-decl.c (pop_scope): Don't print warning in external_scope.
+
2014-10-19 Marek Polacek <polacek@redhat.com>
PR c/63567
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index b18da48..7d1840e 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -1182,7 +1182,8 @@ pop_scope (void)
with an inline function specifier ... shall also be defined
in the same translation unit." */
if (!flag_gnu89_inline
- && !lookup_attribute ("gnu_inline", DECL_ATTRIBUTES (p)))
+ && !lookup_attribute ("gnu_inline", DECL_ATTRIBUTES (p))
+ && scope != external_scope)
pedwarn (input_location, 0,
"inline function %q+D declared but never defined", p);
DECL_EXTERNAL (p) = 1;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 701fadb..48ef70d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2014-10-23 Marek Polacek <polacek@redhat.com>
+ PR c/63626
+ * gcc.dg/pr63626.c: New test.
+
+2014-10-23 Marek Polacek <polacek@redhat.com>
+
* c-c++-common/ubsan/undefined-2.c: New test.
2014-10-10 Kirill Yukhin <kirill.yukhin@intel.com>
diff --git a/gcc/testsuite/gcc.dg/pr63626.c b/gcc/testsuite/gcc.dg/pr63626.c
new file mode 100644
index 0000000..1f03818
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr63626.c
@@ -0,0 +1,8 @@
+/* PR c/63626 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* Test that we don't output the warning twice. */
+
+inline int foo (void); /* { dg-bogus "inline function.*inline function" } */
+/* { dg-warning "inline function .foo. declared but never defined" "" { target *-*-* } 7 } */