Re: Change copyObject() to use typeof_unqual

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Jelte Fennema-Nio" <postgres@jeltef.nl>
Cc: "Peter Eisentraut" <peter@eisentraut.org>, "pgsql-hackers" <pgsql-hackers@postgresql.org>
Date: 2026-03-15T22:13:30Z
Lists: pgsql-hackers
"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?

>> And alternative is that
>> we decide that we don't want to support this combination, meaning that
>> we would effectively require that clang is approximately as-old-or-newer
>> than gcc.

> Given that Tom seems to have reproduced this on Fedora 40, it sounds
> like we should fix it.

Yeah.  Given Fedora's development cycle, it is a certainty that they
shipped gcc and clang versions no more than a couple months different
in age.  So even if we wanted to adopt the restriction Peter suggests,
there are not-very-old systems on which it fails.

			regards, tom lane



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++