diff --git a/meta-oe/recipes-extended/pegtl/pegtl/0001-internal-declare-match_no_control-inline-instead-of-.patch b/meta-oe/recipes-extended/pegtl/pegtl/0001-internal-declare-match_no_control-inline-instead-of-.patch new file mode 100644 index 0000000000..4b0821b9c1 --- /dev/null +++ b/meta-oe/recipes-extended/pegtl/pegtl/0001-internal-declare-match_no_control-inline-instead-of-.patch @@ -0,0 +1,48 @@ +From e5997938100dd459ad9473bf574ab9a75e5a0a53 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 8 Sep 2026 05:31:46 +0000 +Subject: [PATCH] internal: declare match_no_control() inline instead of static + +Newer clang (23+) enables -Wunused-template for namespace-scope static +function templates defined in headers. match_no_control() is only ever +referenced from other templates, so in any translation unit where none of +those get instantiated the internal-linkage template is genuinely unused +and the -Werror test build fails: + + include/tao/pegtl/internal/match_impl.hpp:24:30: error: unused function + template 'match_no_control' [-Werror,-Wunused-template] + +This breaks every test in src/test, since they are all compiled with +-Wall -Werror. + +Declare the two overloads inline instead; that is the correct linkage for +a function template defined in a header and does not trigger the warning. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + include/tao/pegtl/internal/match_impl.hpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/tao/pegtl/internal/match_impl.hpp b/include/tao/pegtl/internal/match_impl.hpp +index 8723dae2..c13dd4f7 100644 +--- a/include/tao/pegtl/internal/match_impl.hpp ++++ b/include/tao/pegtl/internal/match_impl.hpp +@@ -21,7 +21,7 @@ namespace TAO_PEGTL_NAMESPACE::internal + template< typename... > class Control, + typename ParseInput, + typename... States > +- [[nodiscard]] static auto match_no_control( ParseInput& in, States&&... st ) ++ [[nodiscard]] inline auto match_no_control( ParseInput& in, States&&... st ) + -> decltype( Rule::template match< A, M, Action, Control >( in, st... ) ) + { + return Rule::template match< A, M, Action, Control >( in, st... ); +@@ -34,7 +34,7 @@ namespace TAO_PEGTL_NAMESPACE::internal + template< typename... > class Control, + typename ParseInput, + typename... States > +- [[nodiscard]] static auto match_no_control( ParseInput& in, States&&... /*unused*/ ) ++ [[nodiscard]] inline auto match_no_control( ParseInput& in, States&&... /*unused*/ ) + -> decltype( Rule::match( in ) ) + { + return Rule::match( in ); diff --git a/meta-oe/recipes-extended/pegtl/pegtl_4.0.1.bb b/meta-oe/recipes-extended/pegtl/pegtl_4.0.1.bb index afaf8f997b..2ffa570c9f 100644 --- a/meta-oe/recipes-extended/pegtl/pegtl_4.0.1.bb +++ b/meta-oe/recipes-extended/pegtl/pegtl_4.0.1.bb @@ -4,6 +4,7 @@ LICENSE = "BSL-1.0" LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c" SRC_URI = "git://github.com/taocpp/PEGTL.git;protocol=https;branch=4.x \ + file://0001-internal-declare-match_no_control-inline-instead-of-.patch \ file://run-ptest \ "