c++: streamline tf_qualifying_scope usage
commita764d3df8bf289beef2c4305b504a51d5a0718a2
authorPatrick Palka <ppalka@redhat.com>
Wed, 1 Mar 2023 23:25:44 +0000 (1 18:25 -0500)
committerPatrick Palka <ppalka@redhat.com>
Wed, 1 Mar 2023 23:25:44 +0000 (1 18:25 -0500)
tree4ed1b7fdb462b0d83eed39c55b5a31c9c5078a00
parent24ebc5404b88b765221b551dc5288f6d64ba3dc7
c++: streamline tf_qualifying_scope usage

This patch introduces a convenience wrapper tsubst_scope for tsubst'ing
into a type with tf_qualifying_scope set, and makes suitable callers use
it instead of explicitly setting tf_qualifying_scope.  This patch also
makes tsubst_copy immediately delegate to tsubst for all type trees,
which allows tsubst_copy to be oblivious to the tf_qualifying_scope flag.

gcc/cp/ChangeLog:

* pt.cc (tsubst_scope): Define.
(tsubst_decl) <case USING_DECL>: Call tsubst_scope instead of
calling tsubst_scope with tf_qualifying_scope set.
(tsubst_qualified_id): Call tsubst_scope instead of
calling tsubst with tf_qualifying_scope set.
(tsubst_copy): Immediately delegate to tsubst for all TYPE_P
trees.  Remove tf_qualifying_scope manipulation.
<case SCOPE_REF>: Call tsubst_scope instead of calling
tsubst with tf_qualifying_scope set.
gcc/cp/pt.cc