]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/reflection: splices and passing ctx to finish_id_expr
authorMarek Polacek <polacek@redhat.com>
Thu, 19 Feb 2026 15:51:32 +0000 (10:51 -0500)
committerMarek Polacek <polacek@redhat.com>
Mon, 23 Feb 2026 15:48:10 +0000 (10:48 -0500)
commit64545dee159b104db44c2189d5434a67aec5f9fe
treead5fcee17b5ac578d46f7e55020e16833ab0daa5
parent99b63e4ac7ee06e2f5030b72dc876bf35e9842ca
c++/reflection: splices and passing ctx to finish_id_expr

In <https://gcc.gnu.org/pipermail/gcc-patches/2026-January/705175.html>
(bottom of the message) we discussed not passing ctx to finish_id_expression
so that we can get rid of the _deferring_access_checks calls.

We can avoid passing context to finish_id_expression but we can't
completely avoid the _deferring_access_checks calls, because for
address_p we need to call build_offset_ref which needs it.

gcc/cp/ChangeLog:

* parser.cc (cp_parser_splice_expression): For dependent splices return
earlier.  Refactor.  For address_p, build an OFFSET_REF.  Don't pass
context to finish_id_expression.
* semantics.cc (finish_id_expression_1): Adjust an assert to also check
flag_reflection.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/parser.cc
gcc/cp/semantics.cc