pgsql: Enable test_cplusplusext with MSVC

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Enable test_cplusplusext with MSVC
Date: 2026-04-01 05:53:28
Message-ID: E1w7oW7-002Pkc-1K@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Enable test_cplusplusext with MSVC

The test_cplusplusext test module has so far been disabled on MSVC.
The only remaining problem now is that designated initializers, as
used in PG_MODULE_MAGIC, require C++20. (With GCC and Clang they work
in older C++ versions as well.)

This adds another test in the top-level meson.build to check that the
compiler supports C++20 designated initializers. This is not
required, we are just checking and recording the answer. If yes, we
can enable the test module.

Most current compilers likely won't be in C++20 mode by default. This
doesn't change that; we are not doing anything to try to switch the
compiler into that mode. This might be a separate project, but for
now we'll leave that for the user or the test scaffolding.

The VS task on Cirrus CI is changed to provide the required flag to
turn on C++20 mode.

There is no equivalent change in configure, since this change mainly
targets MSVC.

Co-authored-by: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Discussion: https://www.postgresql.org/message-id/flat/CAGECzQR21OnnKiZO_1rLWO0-16kg1JBxnVq-wymYW0-_1cUNtg%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c05ad248f99c729b53f6fa83939266b509682c33

Modified Files
--------------
.cirrus.tasks.yml | 1 +
meson.build | 14 ++++++++++++++
src/test/modules/test_cplusplusext/meson.build | 7 +------
3 files changed, 16 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-04-01 06:24:45 pgsql: Use standard C23 and C++ attributes if available
Previous Message Amit Kapila 2026-04-01 03:44:49 pgsql: Fix miscellaneous issues in EXCEPT publication clause.