Re: Make copyObject work in C++
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Jelte Fennema-Nio <postgres@jeltef.nl>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Thomas Munro <thomas.munro@gmail.com>, Andres Freund <andres@anarazel.de>
Date: 2026-04-01T05:54:07Z
Lists: pgsql-hackers
On 31.03.26 11:09, Jelte Fennema-Nio wrote: > On Tue, 31 Mar 2026 at 10:33, Peter Eisentraut <peter@eisentraut.org> wrote: >> Hmm, note that C++ is also used for LLVM/JIT, and by requiring this >> additional feature set we are also imposing new requirements for those >> users. This has not been fully explored, and I hesitate to add such a >> new requirement at the last moment. > > I understand the hesitation, but in practice we already impose those > requirements anyway for non-MSVC compilers because test_cplusplusext > doesn't compile without it. So any compiler that would cause problems > with the new featureset would have already complained about that > before. > >> But how about this: We add the feature test that you propose and enable >> the extension based on that. See attached patch. This reduces to >> essentially a three-line patch, much simpler than all previous proposals. > > If you're still worried, then this sounds like a fine middle-ground > for now. I think we should reconsider adding the automatic /std:c++20 > flag for the PG20 dev cycle though. Ok, I have committed the shown patch.
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Enable test_cplusplusext with MSVC
- c05ad248f99c 19 (unreleased) landed
-
Disable some C++ warnings in MSVC
- 82a7cbea747c 19 (unreleased) landed
-
meson: Make room for C++-only warning flags for MSVC
- 4c83f1253593 19 (unreleased) landed
-
Make fixed-length list building macros work in C++
- f8e7ca328510 19 (unreleased) landed
-
Make unconstify and unvolatize use StaticAssertVariableIsOfTypeMacro
- 258248d0bdbf 19 (unreleased) landed
-
Use typeof everywhere instead of compiler specific spellings
- e2308350c9b7 19 (unreleased) landed
-
Test List macros in C++ extensions
- 3d28ecb5ac76 19 (unreleased) landed
-
Test most StaticAssert macros in C++ extensions
- 451650eaacd5 19 (unreleased) landed
-
Revert "Change copyObject() to use typeof_unqual"
- 0af05b5dbb42 19 (unreleased) landed
-
Fix for C++ compatibility
- b4555cb070f1 19 (unreleased) landed
-
tests: Add a test C++ extension module
- 476b35d4e311 19 (unreleased) landed