re PR c++/12479 ([3.4 only] System header should not cause -pedantic to error about "extra `;'")

PR c++/12479
	* parser.c (cp_parser_declaration_seq_opt): Only issue "extra ;"
	pedwarn when not in a system header.

	PR c++/12479
	* g++.dg/parse/semicolon1.C: New test.
	* g++.dg/parse/semicolon1.h: Likewise.

From-SVN: r74940
This commit is contained in:
Mark Mitchell 2003-12-22 19:00:12 +00:00 committed by Mark Mitchell
parent fe5597f25e
commit 499b568fe1
5 changed files with 19 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2003-12-22 Mark Mitchell <mark@codesourcery.com>
PR c++/12479
* parser.c (cp_parser_declaration_seq_opt): Only issue "extra ;"
pedwarn when not in a system header.
2003-12-21 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (cp_tree_index): Remove CPTI_RECORD_TYPE,

View file

@ -6128,7 +6128,7 @@ cp_parser_declaration_seq_opt (cp_parser* parser)
{
/* A declaration consisting of a single semicolon is
invalid. Allow it unless we're being pedantic. */
if (pedantic)
if (pedantic && !in_system_header)
pedwarn ("extra `;'");
cp_lexer_consume_token (parser->lexer);
continue;

View file

@ -1,3 +1,9 @@
2003-12-22 Mark Mitchell <mark@codesourcery.com>
PR c++/12479
* g++.dg/parse/semicolon1.C: New test.
* g++.dg/parse/semicolon1.h: Likewise.
2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
PR c/9163

View file

@ -0,0 +1,4 @@
// PR c++/12479
// { dg-options "-pedantic" }
#include "semicolon1.h"

View file

@ -0,0 +1,2 @@
#pragma GCC system_header
;