From c35f57c5bd2b7d3fcf04f7bb8134db43c5b31059 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Thu, 20 Jun 2019 22:06:36 +0000 Subject: [PATCH] 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 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/parse/error62.C | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 gcc/testsuite/g++.dg/parse/error62.C 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 + + PR c++/68265 + * g++.dg/parse/error62.C: New test. + 2019-06-20 Steven G. Kargl 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 +} -- 2.30.2