Fix: cpp-common/bt2: don't pass a lib obj ptr when constructing a `CommonNullValue`
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 13 Mar 2024 15:02:02 +0000 (11:02 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 26 Mar 2024 18:56:36 +0000 (14:56 -0400)
When trying to use `CommonValue::asNull()`, we get:

    /home/smarchi/src/babeltrace/src/cpp-common/bt2/value.hpp:1423:55: error: no matching function for call to 'bt2::CommonNullValue<const bt_value>::CommonNullValue(<brace-enclosed initializer list>)'
     1423 |     return CommonNullValue<LibObjT> {this->libObjPtr()};
          |                                                       ^

The `CommonNullValue` constructor takes no parameter, so don't try to
pass one.

Change-Id: I653ab947fc36134c8767f39185a9a2cd85511b90
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12050
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/cpp-common/bt2/value.hpp

index 6c3c58ca5a4bd9f0f5d0b03caa261aef71133683..14ae5a2b3b7f325dde5be3c6582fde908506fc3f 100644 (file)
@@ -1420,7 +1420,7 @@ template <typename LibObjT>
 CommonNullValue<LibObjT> CommonValue<LibObjT>::asNull() const noexcept
 {
     BT_ASSERT_DBG(this->isNull());
-    return CommonNullValue<LibObjT> {this->libObjPtr()};
+    return CommonNullValue<LibObjT> {};
 }
 
 template <typename LibObjT>
This page took 0.025453 seconds and 4 git commands to generate.