]> gcc.gnu.org Git - gcc.git/commit
c++: cp_parser_constant_expression cleanups
authorMarek Polacek <polacek@redhat.com>
Tue, 25 Jul 2023 18:03:02 +0000 (14:03 -0400)
committerMarek Polacek <polacek@redhat.com>
Wed, 26 Jul 2023 17:09:20 +0000 (13:09 -0400)
commit5bd02d910e990c723a5914a64621a1ac89bc5257
treeb68b283a12f48161e11be31d294c16f9856ca638
parent51b997ea1d07465cb0208c711975b545872a2d2b
c++: cp_parser_constant_expression cleanups

It's pointless to call *_rvalue_constant_expression when we're not using
the result.  Also apply some drive-by cleanups.

gcc/cp/ChangeLog:

* parser.cc (cp_parser_constant_expression): Allow non_constant_p to be
nullptr even when allow_non_constant_p is true.  Don't call
_rvalue_constant_expression when not necessary.  Move local variable
declarations closer to their first use.
(cp_parser_static_assert): Don't pass a dummy down to
cp_parser_constant_expression.
gcc/cp/parser.cc
This page took 0.052106 seconds and 5 git commands to generate.