Fix "PR c++/91073 if constexpr no longer works directly with Concepts."
commit83fe2b921830c177e3dee514aa07cbc7c8ceef1c
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 15 Jan 2020 21:28:46 +0000 (15 22:28 +0100)
committerPaolo Carlini <paolo.carlini@oracle.com>
Wed, 15 Jan 2020 21:28:46 +0000 (15 22:28 +0100)
tree9754091a4864e4d6aa92c7df7031bc5253b07d07
parent299ddc612136421f1d9865ea4f2f84f7e3791824
Fix "PR c++/91073 if constexpr no longer works directly with Concepts."

This is a rather serious regression, filed in July 2019. Luckily the
fix is simple: is localized to parser.c and cp-tree.h in cp and boils
down to only a few lines.

Testing OK on x86_64-linux. Approved off-line by Jason Merrill.

/cp
PR c++/91073
* cp-tree.h (is_constrained_auto): New.
* parser.c (cp_parser_maybe_commit_to_declaration): Correctly
handle concept-check expressions; take a cp_decl_specifier_seq*
instead of a bool.
(cp_parser_condition): Update call.
(cp_parser_simple_declaration): Likewise.
(cp_parser_placeholder_type_specifier): Correctly handle
concept-check expressions.

/testsuite
PR c++/91073
* g++.dg/concepts/pr91073-1.C: New.
* g++.dg/concepts/pr91073-2.C: Likewise.
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/concepts/pr91073-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr91073-2.C [new file with mode: 0644]