From cd083b54bd675a6c941b2d52f398cebbf95b060f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 15 Mar 2026 07:36:27 +0100 Subject: [PATCH] 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). Author: Jelte Fennema-Nio Discussion: https://www.postgresql.org/message-id/flat/92f9750f-c7f6-42d8-9a4a-85a3cbe808f3%40eisentraut.org --- 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 +#define typeof(x) std::remove_reference::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> +#define typeof_unqual(x) std::remove_cv::type>::type #endif #ifndef HAVE_TYPEOF_UNQUAL #define HAVE_TYPEOF_UNQUAL 1