From 10883d7997ed4b53f989a49bd4387c5769fbd12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Date: Thu, 12 Sep 2024 18:46:27 +0100 Subject: [PATCH] Suppress GCC warning in TreeEnsembleAggregator (#22062) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Description When building with GCC 14.2.1, I got the following warning: onnxruntime/core/providers/cpu/ml/tree_ensemble_aggregator.h:329:59: error: template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor] Remove template parameters from the constructor: The constructor TreeAggregatorMax has been simplified to TreeAggregatorMax, because the compiler already knows the template parameters from the class definition. ### Motivation and Context Fix the build issue Signed-off-by: Clément Péron --- .../core/providers/cpu/ml/tree_ensemble_aggregator.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/onnxruntime/core/providers/cpu/ml/tree_ensemble_aggregator.h b/onnxruntime/core/providers/cpu/ml/tree_ensemble_aggregator.h index 34c6db6198..b031a6f0ce 100644 --- a/onnxruntime/core/providers/cpu/ml/tree_ensemble_aggregator.h +++ b/onnxruntime/core/providers/cpu/ml/tree_ensemble_aggregator.h @@ -328,11 +328,10 @@ class TreeAggregatorMin : public TreeAggregator class TreeAggregatorMax : public TreeAggregator { public: - TreeAggregatorMax(size_t n_trees, - const int64_t& n_targets_or_classes, - POST_EVAL_TRANSFORM post_transform, - const std::vector& base_values) : TreeAggregator(n_trees, n_targets_or_classes, - post_transform, base_values) {} + TreeAggregatorMax(size_t n_trees, + const int64_t& n_targets_or_classes, + POST_EVAL_TRANSFORM post_transform, + const std::vector& base_values) : TreeAggregator(n_trees, n_targets_or_classes, post_transform, base_values) {} // 1 output