]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common: fix FTBFS due to dout & need_dynamic on GCC-12
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 19 Jan 2022 15:24:11 +0000 (15:24 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 19 Jan 2022 15:24:16 +0000 (15:24 +0000)
For details see:
https://gist.github.com/rzarzynski/d6d2df6888923bef6a3e764f4856853f.

Special thanks to Kaleb Keithley who reported the issue
and tested the fix!

Fixes: https://tracker.ceph.com/issues/53896
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/common/dout.h

index 421222d535f8d81622eb63222059d66f5a26cb1d..a1375fbb91026877578cd5ebaebe5993b07f9104 100644 (file)
@@ -99,11 +99,12 @@ namespace ceph::dout {
 template<typename T>
 struct dynamic_marker_t {
   T value;
-  operator T() const { return value; }
+  // constexpr ctor isn't needed as it's an aggregate type
+  constexpr operator T() const { return value; }
 };
 
 template<typename T>
-dynamic_marker_t<T> need_dynamic(T&& t) {
+constexpr dynamic_marker_t<T> need_dynamic(T&& t) {
   return dynamic_marker_t<T>{ std::forward<T>(t) };
 }