aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-12-22 19:00:12 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-12-22 19:00:12 +0000
commit499b568fe12465d6d18be42bccfa3adc6fd14d9f (patch)
treeb49655f5e87e2f94d774d05e5c9fc567fee8d234 /gcc
parentfe5597f25eebf3592c6cf27fcceae20b4e752414 (diff)
downloadgcc-499b568fe12465d6d18be42bccfa3adc6fd14d9f.zip
gcc-499b568fe12465d6d18be42bccfa3adc6fd14d9f.tar.gz
gcc-499b568fe12465d6d18be42bccfa3adc6fd14d9f.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/parse/semicolon1.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/semicolon1.h2
5 files changed, 19 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d667193..05b58a8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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,
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 12c883e..eae46cf 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3d9d88a..0eb7417 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/g++.dg/parse/semicolon1.C b/gcc/testsuite/g++.dg/parse/semicolon1.C
new file mode 100644
index 0000000..22c1e86
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/semicolon1.C
@@ -0,0 +1,4 @@
+// PR c++/12479
+// { dg-options "-pedantic" }
+
+#include "semicolon1.h"
diff --git a/gcc/testsuite/g++.dg/parse/semicolon1.h b/gcc/testsuite/g++.dg/parse/semicolon1.h
new file mode 100644
index 0000000..0487fc7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/semicolon1.h
@@ -0,0 +1,2 @@
+#pragma GCC system_header
+;