Re: Change copyObject() to use typeof_unqual

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Jelte Fennema-Nio <postgres@jeltef.nl>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-03-16T12:47:13Z
Lists: pgsql-hackers
On 16.03.26 00:57, Jelte Fennema-Nio wrote:
> On Sun, 15 Mar 2026 at 23:13, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> "Jelte Fennema-Nio" <postgres@jeltef.nl> writes:
>> > If not, then I'm starting to think that actually checking support for
>> > this feature for CLANG is probably easier to understand (and less
>> > fragile) than combining all of these tricks together. Attached is a
>> > patch to do so.
>>
>> +1 for concept, but don't you need to fix meson.build too?
> 
> I believe that we don't have fully working bc compilation for meson[1],
> so I'm not entirely sure how to test out if it actually works. But the
> attached now does *something* for meson too at least.

Yeah, this is tricky to analyze and test because the bc compilation 
doesn't even exist yet.

I'm tempted to go with my proposed patch of a version-based override for 
the time being.




Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add some const qualifiers enabled by typeof_unqual change on copyObject

  2. Hardcode typeof_unqual to __typeof_unqual__ for clang

  3. Clean up postgres_fdw/t/010_subscription.pl.

  4. Hardcode override of typeof_unqual for clang-for-bitcode

  5. Make typeof and typeof_unqual fallback definitions work on C++11

  6. Change copyObject() to use typeof_unqual

  7. Fixes for C++ typeof implementation

  8. Support using copyObject in standard C++