diff mbox series

[oe,meta-oe,2/2] pegtl: Fix build with clang/libc++

Message ID 20190727200614.5661-2-raj.khem@gmail.com
State New
Headers show
Series [oe,meta-oe,1/2] collectd: Fix build with glibc 2.30 | expand

Commit Message

Khem Raj July 27, 2019, 8:06 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

Cc: Ayoub Zaki <ayoub.zaki@embexus.com>
---
 .../0001-add-missing-virtual-dtors.patch      | 72 +++++++++++++++++++
 meta-oe/recipes-extended/pegtl/pegtl_2.1.4.bb |  4 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-extended/pegtl/pegtl/0001-add-missing-virtual-dtors.patch

-- 
2.22.0

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/pegtl/pegtl/0001-add-missing-virtual-dtors.patch b/meta-oe/recipes-extended/pegtl/pegtl/0001-add-missing-virtual-dtors.patch
new file mode 100644
index 0000000000..829c8ae5cb
--- /dev/null
+++ b/meta-oe/recipes-extended/pegtl/pegtl/0001-add-missing-virtual-dtors.patch
@@ -0,0 +1,72 @@ 
+From 2c7cc8c669e513154e98762d6ed7c6d1bf338505 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Jul 2019 12:54:49 -0700
+Subject: [PATCH] add missing virtual dtors
+
+Fixes clang warnings
+/usr/include/c++/v1/memory:3710:5: error: destructor called on non-final 'examples::null_json' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-abstract-non-virtual-dtor]
+__data_.second().~_Tp();
+^
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted [https://github.com/taocpp/PEGTL/pull/181]
+---
+ src/example/pegtl/json_classes.hpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/example/pegtl/json_classes.hpp b/src/example/pegtl/json_classes.hpp
+index 7227870c..9ea66ce7 100644
+--- a/src/example/pegtl/json_classes.hpp
++++ b/src/example/pegtl/json_classes.hpp
+@@ -58,6 +58,7 @@ namespace examples
+          : json_base( json_type::ARRAY )
+       {
+       }
++      virtual ~array_json() {}
+ 
+       std::vector< std::shared_ptr< json_base > > data;
+ 
+@@ -83,6 +84,7 @@ namespace examples
+            data( in_data )
+       {
+       }
++      virtual ~boolean_json() {}
+ 
+       bool data;
+ 
+@@ -99,7 +101,7 @@ namespace examples
+          : json_base( json_type::NULL_ )
+       {
+       }
+-
++      virtual ~null_json() {}
+       virtual void stream( std::ostream& o ) const override
+       {
+          o << "null";
+@@ -114,6 +116,7 @@ namespace examples
+            data( in_data )
+       {
+       }
++      virtual ~number_json() {}
+ 
+       long double data;
+ 
+@@ -179,6 +182,7 @@ namespace examples
+            data( in_data )
+       {
+       }
++      virtual ~string_json() {}
+ 
+       std::string data;
+ 
+@@ -195,6 +199,7 @@ namespace examples
+          : json_base( json_type::OBJECT )
+       {
+       }
++      virtual ~object_json() {}
+ 
+       std::map< std::string, std::shared_ptr< json_base > > data;
+ 
+-- 
+2.22.0
+
diff --git a/meta-oe/recipes-extended/pegtl/pegtl_2.1.4.bb b/meta-oe/recipes-extended/pegtl/pegtl_2.1.4.bb
index f41eef2a01..5cea295c5a 100644
--- a/meta-oe/recipes-extended/pegtl/pegtl_2.1.4.bb
+++ b/meta-oe/recipes-extended/pegtl/pegtl_2.1.4.bb
@@ -4,7 +4,9 @@  LICENSE="MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=80cb066ab204c7fe022f1cfe0c2c6818"
 
 SRCREV = "776fa4a1e8bda860008524f6dd9473967c8375b1"
-SRC_URI = "git://git@github.com/taocpp/PEGTL.git;protocol=https;branch=master"
+SRC_URI = "git://git@github.com/taocpp/PEGTL.git;protocol=https;branch=master \
+           file://0001-add-missing-virtual-dtors.patch \
+          "
 
 inherit cmake