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:
parent
fe5597f25e
commit
499b568fe1
5 changed files with 19 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
4
gcc/testsuite/g++.dg/parse/semicolon1.C
Normal file
4
gcc/testsuite/g++.dg/parse/semicolon1.C
Normal file
|
@ -0,0 +1,4 @@
|
|||
// PR c++/12479
|
||||
// { dg-options "-pedantic" }
|
||||
|
||||
#include "semicolon1.h"
|
2
gcc/testsuite/g++.dg/parse/semicolon1.h
Normal file
2
gcc/testsuite/g++.dg/parse/semicolon1.h
Normal file
|
@ -0,0 +1,2 @@
|
|||
#pragma GCC system_header
|
||||
;
|
Loading…
Add table
Reference in a new issue