Commit 499b568f by Mark Mitchell Committed by Mark Mitchell

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
parent fe5597f2
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> 2003-12-21 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (cp_tree_index): Remove CPTI_RECORD_TYPE, * cp-tree.h (cp_tree_index): Remove CPTI_RECORD_TYPE,
......
...@@ -6128,7 +6128,7 @@ cp_parser_declaration_seq_opt (cp_parser* parser) ...@@ -6128,7 +6128,7 @@ cp_parser_declaration_seq_opt (cp_parser* parser)
{ {
/* A declaration consisting of a single semicolon is /* A declaration consisting of a single semicolon is
invalid. Allow it unless we're being pedantic. */ invalid. Allow it unless we're being pedantic. */
if (pedantic) if (pedantic && !in_system_header)
pedwarn ("extra `;'"); pedwarn ("extra `;'");
cp_lexer_consume_token (parser->lexer); cp_lexer_consume_token (parser->lexer);
continue; continue;
......
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> 2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
PR c/9163 PR c/9163
......
// PR c++/12479
// { dg-options "-pedantic" }
#include "semicolon1.h"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment