folly
folly copied to clipboard
Tests fail to compile: error: 'auto' not allowed in function prototype
/usr/ports/devel/folly/work/folly-2023.06.26.00/folly/detail/test/SimdForEachTest.cpp:32:45: error: 'auto' not allowed in function prototype
bool step(char* s, ignore_extrema ignore, auto unroll_i) const {
^~~~
/usr/ports/devel/folly/work/folly-2023.06.26.00/folly/detail/test/SimdForEachTest.cpp:53:35: error: 'auto' not allowed in function prototype
bool step(char* s, ignore_none, auto unroll_i) const {
^~~~
In file included from /usr/ports/devel/folly/work/folly-2023.06.26.00/folly/detail/test/SimdForEachTest.cpp:17:
/usr/ports/devel/folly/work/folly-2023.06.26.00/folly/detail/SimdForEach.h:209:18: error: no member named 'step' in 'folly::simd_detail::TestDelegate<true>'
if (delegate.step(af, ignore, detail::UnrollStep<0>{})) {
~~~~~~~~ ^
/usr/ports/devel/folly/work/folly-2023.06.26.00/folly/detail/test/SimdForEachTest.cpp:84:3: note: in instantiation of function template specialization 'folly::simd_detail::simdForEachAligning<2, char, folly::simd_detail::TestDelegate<true>>' requested here
simdForEachAligning<unroll>(
^
/usr/ports/devel/folly/work/folly-2023.06.26.00/folly/detail/test/SimdForEachTest.cpp:91:19: note: in instantiation of function template specialization 'folly::simd_detail::run<2, true>' requested here
EXPECT_EQ(res, (run<2, /*kSameUnrollValue*/ true>(offset, len, stopAt)));
^
In file included from /usr/ports/devel/folly/work/folly-2023.06.26.00/folly/detail/test/SimdForEachTest.cpp:17:
/usr/ports/devel/folly/work/folly-2023.06.26.00/folly/detail/SimdForEach.h:227:12: error: no member named 'step' in 'folly::simd_detail::TestDelegate<true>'
delegate.step(af, ignore, detail::UnrollStep<0>{});
~~~~~~~~ ^
/usr/ports/devel/folly/work/folly-2023.06.26.00/folly/detail/SimdForEach.h:137:30: error: no member named 'step' in 'folly::simd_detail::TestDelegate<true>'
shouldBreak = delegate.step(f, ignore_none{}, unrollI);
~~~~~~~~ ^
Version: 2023.06.26.00 clang-15 FreeBSD 13.2
It seems the usage is allowed in cpp20.
any update on this?
I've put up a change internally to change this to:
template <typename Func>
bool step(char* s, ignore_extrema ignore, Func unroll_i) const {
Which should resolve the issue by supporting compiling against things before C++20. I hope to land it soon.
in c++ versions 14,17 and 20 on gcc v9 you can use the auto type for function prototypes. But you will have the warning : \main.cpp [Warning] use of 'auto' in parameter declaration only available with '-fconcepts' this warning can also be suppressed by the -w parameter
Clang always prints an error in this case.
Clang always prints an error in this case.
Oh😮 this is intersting!?
https://github.com/facebook/folly/pull/2039 should fix this when it lands.