v3-0001-Make-typeof-and-typeof_unqual-fallback-definition.patch
text/x-patch
Filename: v3-0001-Make-typeof-and-typeof_unqual-fallback-definition.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v3-0001
Subject: Make typeof and typeof_unqual fallback definitions work on C++11
| File | + | − |
|---|---|---|
| src/include/c.h | 2 | 2 |
From d7acf4680fcfa81d0b046241ee5e36fd47f46b06 Mon Sep 17 00:00:00 2001 From: Jelte Fennema-Nio <postgres@jeltef.nl> Date: Sat, 14 Mar 2026 14:33:07 +0100 Subject: [PATCH v3] Make typeof and typeof_unqual fallback definitions work on C++11 These macros were unintentionally using C++14 features. This replaces them with valid C++11 code. Tested locally by compiling with -std=c++11 (which reproduced the original issue). --- src/include/c.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/c.h b/src/include/c.h index 2aab74d8b0e..29fef2f54e1 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -447,7 +447,7 @@ extern "C++" #ifdef pg_cxx_typeof #define typeof(x) pg_cxx_typeof(x) #elif !defined(HAVE_CXX_TYPEOF) -#define typeof(x) std::remove_reference_t<decltype(x)> +#define typeof(x) std::remove_reference<decltype(x)>::type #endif #ifndef HAVE_TYPEOF #define HAVE_TYPEOF 1 @@ -459,7 +459,7 @@ extern "C++" #ifdef pg_cxx_typeof_unqual #define typeof_unqual(x) pg_cxx_typeof_unqual(x) #elif !defined(HAVE_CXX_TYPEOF_UNQUAL) -#define typeof_unqual(x) std::remove_cv_t<std::remove_reference_t<decltype(x)>> +#define typeof_unqual(x) std::remove_cv<std::remove_reference<decltype(x)>::type>::type #endif #ifndef HAVE_TYPEOF_UNQUAL #define HAVE_TYPEOF_UNQUAL 1 base-commit: ae58189a4d523f0156ebe30f4534180555669e88 -- 2.53.0