Re: Gradual 'tree' typing and C++
Jakub Jelinek via Gcc <[email protected]> Tue, 21 Jul 2026 20:47:11 +0200
| Newsgroups | gmane.comp.gcc.devel |
|---|---|
| Message-ID | <al--r68ddzGweLld@tucnak> |
On Tue, Jul 21, 2026 at 08:34:09PM +0200, Arsen Arsenović wrote: > Checks-and-uses of TREE_CODEs would also need to become (explicit) > fallible conversion functions, i.e. > > if (TREE_CODE (t) == A) use t; > > ... becomes: > > if (auto tA = try_as_tree_or_whatever<A> (t)) use tA; > > ... or such. (I'd have preferred if the 'tA' could shadow 't', but > unfortunately if it were to shadow 't' in the then branch, it'd also > have to shadow it - a lot less usefully - in the else branch; that's not > an issue in this trivial example but is in general) I'm sorry, but this is not an improvement, it is an exact opposite of that. Jakub