2020-11-19 10:39 AM
I am using IDE 1.5.0 with the -std=gnu++17 flag set
When trying to use fold expression, the compiler throws an error.
2020-11-19 12:06 PM
I'm not keen on new language features, but a simple test worked when test() called from main():
template <typename... Ty>
auto sum(Ty... args) {
return (args + ...);
}
extern "C" int test()
{
return sum(1,2,3);
}
This is more a g++ question rather than STM.
2020-11-19 12:44 PM
STM32CubeIDE 1.5.0 (1.4.2 is fine too) no issue to me if C++17 usage. According to me proper g++ switch is "-std=c++17" not "-std=gnu++17"
2020-11-19 12:52 PM
It doesn't work for me and on -std = c ++ 17
2020-11-19 12:55 PM
Correction: works, but IDE emphasizes fold expression. Apparently we should expect further fixes.
2020-11-19 01:08 PM
Compiler (gcc/g++ here) is one thing, C editor code analysis engine another ...
Maybe CDT is late here (but 2017 post) ? https://www.eclipse.org/community/eclipse_newsletter/2017/april/article3.php