[tmva][sofie] Fix compiler warning in tests #21215
Merged
+28
−25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The last commit that changed the tests left a compiler warning:
In file included from /home/rembserj/code/root/root_src/tmva/sofie/test/TestCustomModelsFromONNX.cxx:3: /home/rembserj/code/root/root_src/tmva/sofie/test/test_helpers.h: In instantiation of ‘OutputType_t runModel(std::string, const std::string&, std::string, const Ts& ...) [with OutputType_t = std::vector<float>; Ts = {}; std::string = std::__cxx11::basic_string<char>]’: /home/rembserj/code/root/root_src/tmva/sofie/test/TestCustomModelsFromONNX.cxx:318:4: required from here 130 | auto output = runModel<OutputType>(#OutputType, _modelName, ""); | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/rembserj/code/root/root_src/tmva/sofie/test/test_helpers.h:74:9: warning: variable ‘type_name’ set but not used [-Wunused-but-set-variable] 74 | auto type_name = []<typename T>() { | ^~~~~~~~~ /home/rembserj/code/root/root_src/tmva/sofie/test/test_helpers.h:107:9: warning: variable ‘first’ set but not used [-Wunused-but-set-variable] 107 | bool first = true; | ^~~~~ cc1plus: note: unrecognized command-line option ‘-Wno-unused-command-line-argument’ may have been intended to silence earlier diagnosticsThis can be avoided by guarding the parameter pack expension in an if clause that checks if the size of the parameter pack is not empty.