summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2019-06-20 22:06:36 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2019-06-20 22:06:36 +0000
commitc35f57c5bd2b7d3fcf04f7bb8134db43c5b31059 (patch)
tree84252defab0849187a337fa25e2f6382ee14191c
parent966e7f731ef7ea019e681b7b53421c6857315c4a (diff)
downloadgcc-c35f57c5bd2b7d3fcf04f7bb8134db43c5b31059.tar.gz
re PR c++/68265 (Arbitrary syntactic nonsense silently accepted after 'int (*){}' until the next close brace)
PR c++/68265 * g++.dg/parse/error62.C: New test. From-SVN: r272525
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/parse/error62.C10
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c6130e5eea2..48ca72f0e53 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-06-20 Marek Polacek <polacek@redhat.com>
+
+ PR c++/68265
+ * g++.dg/parse/error62.C: New test.
+
2019-06-20 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/86587
diff --git a/gcc/testsuite/g++.dg/parse/error62.C b/gcc/testsuite/g++.dg/parse/error62.C
new file mode 100644
index 00000000000..8dac0ffc0d5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/error62.C
@@ -0,0 +1,10 @@
+// PR c++/68265
+
+int main()
+{
+ int (*) {} // { dg-error "expected primary-expression" }
+ any amount of syntactic nonsense // { dg-error "not declared in this scope" }
+ on multiple lines, with *punctuation* and ++operators++ even...
+ will be silently discarded
+ until the next close brace
+}