aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2017-10-12 17:29:15 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2017-10-12 17:29:15 +0000
commite95c91292876830c8e36b0a55f0c03d1247aaccb (patch)
treeebedc33278fd940d2f13db951d60f5634e8eaf83 /gcc/testsuite
parent2c79bfcfc985e116ad1ef85579168428f14f0538 (diff)
downloadgcc-e95c91292876830c8e36b0a55f0c03d1247aaccb.zip
gcc-e95c91292876830c8e36b0a55f0c03d1247aaccb.tar.gz
gcc-e95c91292876830c8e36b0a55f0c03d1247aaccb.tar.bz2
C++: avoid partial duplicate implementation of cp_parser_error
In r251026 (aka 3fe34694f0990d1d649711ede0326497f8a849dc, "C/C++: show pertinent open token when missing a close token") I copied part of cp_parser_error into cp_parser_required_error, leading to duplication of code. This patch eliminates this duplication by merging the two copies of the code into a new cp_parser_error_1 subroutine. Doing so removes an indentation level, making the patch appear to have more churn than it really does. The patch also undoes the change to g++.dg/parse/pragma2.C, as the old behavior is restored. From-SVN: r253686
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/parse/pragma2.C4
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2fa01d4..47b3f78 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-12 David Malcolm <dmalcolm@redhat.com>
+
+ * g++.dg/parse/pragma2.C: Update to reflect reinstatement of the
+ "#pragma is not allowed here" error.
+
2017-10-12 Bin Cheng <bin.cheng@arm.com>
* gcc.dg/tree-ssa/ldist-28.c: New test.
diff --git a/gcc/testsuite/g++.dg/parse/pragma2.C b/gcc/testsuite/g++.dg/parse/pragma2.C
index 3dc5fc1..c5616ff 100644
--- a/gcc/testsuite/g++.dg/parse/pragma2.C
+++ b/gcc/testsuite/g++.dg/parse/pragma2.C
@@ -4,5 +4,5 @@
// does not.
int f(int x,
#pragma interface // { dg-error "not allowed here" }
- // { dg-bogus "expected identifier" "" { xfail *-*-* } .-1 }
- int y);
+ // The parser gets confused and issues an error on the next line.
+ int y); // { dg-bogus "" "" { xfail *-*-* } }