Commit 2e8c34a
committed
[tmva][sofie] Fix compiler warning in tests
The last commit that changed the tests left a compiler warning:
```txt
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 diagnostics
```
This 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.1 parent 305c865 commit 2e8c34a
1 file changed
Lines changed: 28 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 73 | | |
90 | 74 | | |
91 | 75 | | |
| |||
104 | 88 | | |
105 | 89 | | |
106 | 90 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
| |||
0 commit comments