/cp
commite4ddfbc4c1d49271c7c17e574c522a53f9152522
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 May 2018 19:25:50 +0000 (21 19:25 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 May 2018 19:25:50 +0000 (21 19:25 +0000)
tree11692eed301ed0825ad27370dcef0b4ccf3c2482
parentb2f133912a96e498507867a59ecc714c0f448f1b
/cp
2018-05-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84588
* parser.c (cp_parser_maybe_commit_to_declaration,
cp_parser_check_condition_declarator): New.
(cp_parser_simple_declaration): Use the first above.
(cp_parser_condition): Use both the above; enforce
[stmt.stmt]/2 about the declarator not specifying
a function or an array; improve error-recovery.

/testsuite
2018-05-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84588
* g++.dg/cpp0x/cond1.C: New.
* g++.dg/cpp1y/pr84588-1.C: Likewise.
* g++.dg/cpp1y/pr84588-2.C: Likewise.
* g++.dg/cpp1y/pr84588-3.C: Likewise.
* g++.dg/parse/cond6.C: Likewise.
* g++.dg/parse/cond7.C: Likewise.
* g++.dg/parse/cond8.C: Likewise.
* g++.dg/cpp1z/decomp16.C: Update.
* g++.old-deja/g++.jason/cond.C: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260482 138bc75d-0d04-0410-961f-82ee72b054a4
12 files changed:
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/cond1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/pr84588-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/pr84588-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/pr84588-3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/decomp16.C
gcc/testsuite/g++.dg/parse/cond6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/cond7.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/cond8.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.jason/cond.C