From ebf025238d9ed9a5039c539d7fd735e6e70180d8 Mon Sep 17 00:00:00 2001
From: Joseph Myers <jsm28@cam.ac.uk>
Date: Mon, 13 Nov 2000 20:00:22 +0000
Subject: [PATCH] c-parse.in (stmts_and_decls): Deprecate use of label at end
 of compound statement.

	* c-parse.in (stmts_and_decls): Deprecate use of label at end of
	compound statement.

testsuite:
	* gcc.dg/wtr-label-1.c, gcc.dg/990214-1.c: Add semicolons after
	labels at end of compound statements.

From-SVN: r37435
---
 gcc/ChangeLog                      | 5 +++++
 gcc/c-parse.in                     | 3 +--
 gcc/testsuite/ChangeLog            | 5 +++++
 gcc/testsuite/gcc.dg/990214-1.c    | 2 +-
 gcc/testsuite/gcc.dg/wtr-label-1.c | 4 ++--
 5 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e980c45b086c..bf184f5d3ef7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-13  Joseph S. Myers  <jsm28@cam.ac.uk>
+
+	* c-parse.in (stmts_and_decls): Deprecate use of label at end of
+	compound statement.
+
 2000-11-13  Neil Booth  <neilb@earthling.net>
 
         * cpplex.c (_cpp_lex_token): CPP_COMMENT and true CPP_EOF
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 0f3d2ab5bef0..288d248e52a5 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -1584,8 +1584,7 @@ stmts_and_decls:
 	| lineno_stmt_decl_or_labels_ending_decl
 	| lineno_stmt_decl_or_labels_ending_label
 		{
-		  if (pedantic)
-		    pedwarn ("ISO C forbids label at end of compound statement");
+		  pedwarn ("deprecated use of label at end of compound statement");
 		}
 	| lineno_stmt_decl_or_labels_ending_error
 	;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3cd833b512ca..16e51fde621b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-13  Joseph S. Myers  <jsm28@cam.ac.uk>
+
+	* gcc.dg/wtr-label-1.c, gcc.dg/990214-1.c: Add semicolons after
+	labels at end of compound statements.
+
 2000-11-13  Jakub Jelinek  <jakub@redhat.com>
 
 	* gcc.c-torture/execute/loop-7.c: New test.
diff --git a/gcc/testsuite/gcc.dg/990214-1.c b/gcc/testsuite/gcc.dg/990214-1.c
index 5701b5df7136..492c6a7dcea2 100644
--- a/gcc/testsuite/gcc.dg/990214-1.c
+++ b/gcc/testsuite/gcc.dg/990214-1.c
@@ -10,6 +10,6 @@ bar (int64_t which)
 		break;
 	case 1 :
 	case 5 :
-	case 2 :
+	case 2 : ;
 	}
 }
diff --git a/gcc/testsuite/gcc.dg/wtr-label-1.c b/gcc/testsuite/gcc.dg/wtr-label-1.c
index 8c7d73ac6207..98f3eeba1731 100644
--- a/gcc/testsuite/gcc.dg/wtr-label-1.c
+++ b/gcc/testsuite/gcc.dg/wtr-label-1.c
@@ -25,7 +25,7 @@ testfunc1 (int foo6)
  testfunc1: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
  a: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
  i:
- j:
+ j: ;
 }
   
 #line 32 "sys-header.h" 3
@@ -46,5 +46,5 @@ testfunc2 (int foo6)
  testfunc2:
  a:
  i:
- j:
+ j: ;
 }
-- 
GitLab