public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-4829] objc++: type/expr tsubst conflation [PR111920]
@ 2023-10-22 20:14 Patrick Palka
0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2023-10-22 20:14 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:80ddcb9c8f9b5a387f379e1db39bc6f3680bd52f
commit r14-4829-g80ddcb9c8f9b5a387f379e1db39bc6f3680bd52f
Author: Patrick Palka <ppalka@redhat.com>
Date: Sun Oct 22 16:13:33 2023 -0400
objc++: type/expr tsubst conflation [PR111920]
After r14-4796-g3e3d73ed5e85e7, tsubst_copy_and_build (now named
tsubst_expr) no longer dispatches to tsubst for type trees, and
callers have to do it themselves if appropriate. This patch makes
some overlooked adjustments to Objective-C++-specific code paths.
PR objc++/111920
gcc/cp/ChangeLog:
* pt.cc (tsubst_expr) <case AT_ENCODE_EXPR>: Use tsubst instead
of tsubst_expr.
gcc/objcp/ChangeLog:
* objcp-lang.cc (objcp_tsubst_expr) <case CLASS_REFERENCE_EXPR>:
Use tsubst instead of tsubst_expr for type operands.
Diff:
---
gcc/cp/pt.cc | 2 +-
gcc/objcp/objcp-lang.cc | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 210c6cb9e4d3..1c1c93131180 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -20261,7 +20261,7 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
op1 = TREE_OPERAND (t, 0);
++cp_unevaluated_operand;
++c_inhibit_evaluation_warnings;
- op1 = tsubst_expr (op1, args, complain, in_decl);
+ op1 = tsubst (op1, args, complain, in_decl);
--cp_unevaluated_operand;
--c_inhibit_evaluation_warnings;
RETURN (objc_build_encode_expr (op1));
diff --git a/gcc/objcp/objcp-lang.cc b/gcc/objcp/objcp-lang.cc
index 5b04cd66290f..ee39aece8484 100644
--- a/gcc/objcp/objcp-lang.cc
+++ b/gcc/objcp/objcp-lang.cc
@@ -66,8 +66,14 @@ objcp_tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
RECURSE (TREE_OPERAND (t, 2)), NULL);
case CLASS_REFERENCE_EXPR:
- return objc_get_class_reference
- (RECURSE (TREE_OPERAND (t, 0)));
+ {
+ tree ident = TREE_OPERAND (t, 0);
+ if (TYPE_P (ident))
+ ident = tsubst (ident, args, complain, in_decl);
+ else
+ ident = RECURSE (ident);
+ return objc_get_class_reference (ident);
+ }
default:
break;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-10-22 20:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-22 20:14 [gcc r14-4829] objc++: type/expr tsubst conflation [PR111920] Patrick Palka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).