Re: Change copyObject() to use typeof_unqual
Álvaro Herrera <alvherre@kurilemu.de>
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>, Jelte Fennema-Nio <postgres@jeltef.nl>
Date: 2026-06-13T12:14:02Z
Lists: pgsql-hackers
On 2026-Mar-06, Peter Eisentraut wrote:
> From f2f750f7c3ab6b73514ab2fd5f02185abe9ad59f Mon Sep 17 00:00:00 2001
> From: Peter Eisentraut <peter@eisentraut.org>
> Date: Fri, 6 Mar 2026 13:31:01 +0100
> Subject: [PATCH v2 1/3] Fixes for C++ typeof implementation
>
> This fixes two bugs in commit 1887d822f14.
>
> First, if we are using the fallback C++ implementation of typeof, then
> we need to include the C++ header <type_traits> for
> std::remove_reference_t. This header is also likely to be used for
> other C++ implementations of type tricks, so we'll put it into the
> global includes.
For some reason, a couple of animals running gcc-15 or newer
(leafhopper, massasauga, parula) appear to be failing now because of
this.
ccache gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wmissing-format-attribute -Wold-style-declaration -Wimplicit-fallthrough=5 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -Wmissing-variable-declarations -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -Wstrict-prototypes -Wold-style-definition -fPIC -fvisibility=hidden -shared -o test_slru.so test_slru.o test_multixact.o -L../../../../src/port -L../../../../src/common -Wl,--as-needed -Wl,-rpath,'/home/bf/proj/bf/build-farm-17/HEAD/inst/lib',--enable-new-dtags -fvisibility=hidden
In file included from ../../../../src/include/postgres.h:48,
from test_cplusplusext.cpp:18:
../../../../src/include/c.h:91:10: fatal error: type_traits: No such file or directory
91 | #include <type_traits>
| ^~~~~~~~~~~~~
compilation terminated.
make[1]: *** [<builtin>: test_cplusplusext.o] Error 1
make[1]: Leaving directory '/home/bf/proj/bf/build-farm-17/HEAD/pgsql.build/src/test/modules/test_cplusplusext'
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add some const qualifiers enabled by typeof_unqual change on copyObject
- 7724cb9935a9 19 (unreleased) landed
-
Hardcode typeof_unqual to __typeof_unqual__ for clang
- 2eb6cd327cae 19 (unreleased) landed
-
Clean up postgres_fdw/t/010_subscription.pl.
- f4af7849b3db 19 (unreleased) cited
-
Hardcode override of typeof_unqual for clang-for-bitcode
- 63275ce84d2f 19 (unreleased) landed
-
Make typeof and typeof_unqual fallback definitions work on C++11
- cd083b54bd67 19 (unreleased) landed
-
Change copyObject() to use typeof_unqual
- 59292f7aac72 19 (unreleased) landed
- 4cfce4e62c8f 19 (unreleased) landed
-
Fixes for C++ typeof implementation
- 9c05f152b5dd 19 (unreleased) landed
-
Support using copyObject in standard C++
- 1887d822f142 19 (unreleased) cited