From 8d585b8aae15e1311b4b4d8812cfa8fc46e78f3c Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Wed, 1 Mar 2023 06:40:26 -0800 Subject: [PATCH] sys/cbprintf: Limit C++ rvalue references to compatible standards This feature didn't appear until C++11, so don't expose our wrapper for it in C++98. Signed-off-by: Andy Ross --- include/zephyr/sys/cbprintf_cxx.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/zephyr/sys/cbprintf_cxx.h b/include/zephyr/sys/cbprintf_cxx.h index 1e2b9985b28b04a..dbd7b6442cc7245 100644 --- a/include/zephyr/sys/cbprintf_cxx.h +++ b/include/zephyr/sys/cbprintf_cxx.h @@ -249,10 +249,12 @@ struct z_cbprintf_cxx_remove_reference < T & > { typedef T type; }; +#ifndef CONFIG_STD_CPP98 template < typename T > struct z_cbprintf_cxx_remove_reference < T && > { typedef T type; }; +#endif template < typename T > struct z_cbprintf_cxx_remove_cv {