ETLCPP / etl

Embedded Template Library
https://www.etlcpp.com
MIT License
2.25k stars 393 forks source link

template not allowed warning in parameter pack #972

Open jputcu opened 3 weeks ago

jputcu commented 3 weeks ago

On etl-20.39.4 using ZakKemble avr-gcc-14 I get the following warning:

/include/etl/parameter_pack.h:141:56: warning: keyword 'template' not allowed in declarator-id [-Wpedantic]
  141 |   constexpr size_t parameter_pack<TTypes...>::template index_of_type<T>::value;
      |                                                        ^~~~~~~~~~~~~~~~

Note that this warning doesn't occur on avr-gcc-7.3

jwellbelove commented 3 weeks ago

I think I've come across issues like this before where one compiler rejects it, and another requires it.

jwellbelove commented 2 weeks ago

Can you try replacing parameter_pack.h with the one in this zip file?

parameter_pack.zip

jwellbelove commented 2 weeks ago

Can you check both avr-gcc-7.3 & avr-gcc-14?

jputcu commented 2 weeks ago

I just tried on both and the warning is gone now. Would it be an idea to extend your CI to compile the unittests for AVR using the avr-g++7.3 (used by Arduino and Microchip)? This would catch many of the warnings I got in the past. One step further could even be to run the unittests using an AVR simulator?

jwellbelove commented 2 weeks ago

If I ever get the spare time, I'll look into it.