re PR c++/68265 (Arbitrary syntactic nonsense silently accepted after 'int (*){}...
authorMarek Polacek <polacek@redhat.com>
Thu, 20 Jun 2019 22:06:36 +0000 (22:06 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 20 Jun 2019 22:06:36 +0000 (22:06 +0000)
PR c++/68265
* g++.dg/parse/error62.C: New test.

From-SVN: r272525

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/error62.C [new file with mode: 0644]

index c6130e5..48ca72f 100644 (file)
@@ -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 (file)
index 0000000..8dac0ff
--- /dev/null
@@ -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
+}