c++: Improve init handling
authorJason Merrill <jason@redhat.com>
Tue, 24 Nov 2020 23:21:38 +0000 (18:21 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 2 Dec 2020 21:14:21 +0000 (16:14 -0500)
commitd9288bd28e24c755a7216311ee5247e7c88270a6
tree568fbad2383c1885b79d96e21ac24ca3d36c4968
parent07589ca2b2c84ec9609861ff5d119ed7413fd9c5
c++: Improve init handling

While looking at another issue I noticed that in a template we were failing
to find the INIT_EXPR we were looking for, and so ended up doing redundant
processing.  No testcase, as the redundant processing ended up getting the
right result.

gcc/cp/ChangeLog:

* decl.c (check_initializer): Also look through STMT_EXPR
and BIND_EXPR.
gcc/cp/decl.c