+cc maintainer
On Mon, Apr 16 2018, Alexander Bluhm <[email protected]> wrote:
> Hi,
>
> This fixes facter build with clang6.
>
> /usr/include/c++/v1/memory:2541:13: error: delete called on
> 'facter::facts::external::resolver' that is abstract but has non-virtual
> destructor [-Werror,-Wdelete-non-virtual-dtor]
> delete __ptr;
> ^
> /usr/include/c++/v1/memory:2541:13: error: delete called on non-final
> 'facter::facts::collection' that has virtual functions but non-virtual
> destructor [-Werror,-Wdelete-non-virtual-dtor]
> delete __ptr;
> ^
>
> ok?
We should really stop using -Werror (iiuc those CFLAGS come from
leatherman) but the fix looks right anyway. ok jca@
> bluhm
>
> Index: sysutils/facter/patches/patch-lib_inc_facter_facts_collection_hpp
> ===================================================================
> RCS file: sysutils/facter/patches/patch-lib_inc_facter_facts_collection_hpp
> diff -N sysutils/facter/patches/patch-lib_inc_facter_facts_collection_hpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ sysutils/facter/patches/patch-lib_inc_facter_facts_collection_hpp 15 Apr
> 2018 22:36:22 -0000
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +
> +Index: lib/inc/facter/facts/collection.hpp
> +--- lib/inc/facter/facts/collection.hpp.orig
> ++++ lib/inc/facter/facts/collection.hpp
> +@@ -101,7 +101,7 @@ namespace facter { namespace facts {
> + /**
> + * Destructor for fact collection.
> + */
> +- ~collection();
> ++ virtual ~collection();
> +
> + /**
> + * Prevents the fact collection from being copied.
> Index:
> sysutils/facter/patches/patch-lib_inc_facter_facts_external_resolver_hpp
> ===================================================================
> RCS file:
> sysutils/facter/patches/patch-lib_inc_facter_facts_external_resolver_hpp
> diff -N
> sysutils/facter/patches/patch-lib_inc_facter_facts_external_resolver_hpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ sysutils/facter/patches/patch-lib_inc_facter_facts_external_resolver_hpp
> 16 Apr 2018 00:07:52 -0000
> @@ -0,0 +1,17 @@
> +$OpenBSD$
> +
> +Index: lib/inc/facter/facts/external/resolver.hpp
> +--- lib/inc/facter/facts/external/resolver.hpp.orig
> ++++ lib/inc/facter/facts/external/resolver.hpp
> +@@ -44,6 +44,11 @@ namespace facter { namespace facts { namespace externa
> + * @param facts The fact collection to populate the external facts
> into.
> + */
> + virtual void resolve(std::string const& path, collection& facts)
> const = 0;
> ++
> ++ /**
> ++ * Destructor for external resolver.
> ++ */
> ++ virtual ~resolver() {}
> + };
> +
> + }}} // namespace facter::facts::external
>
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE