Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Older versions of GCC fail to expand template parameter pack that appears in a lambda-expression #134

Open
lydia-at-amazon opened this issue Aug 16, 2024 · 0 comments
Assignees

Comments

@lydia-at-amazon
Copy link

When trying to compile CETL with gcc 7.3.1, we ran into this compiler error:

/local/p4clients/pkgbuild-const/workspace/src/AdnExCyphalEmbeddedTemplateLibrary/include/cetl/pf17/variant.hpp:91:51: error: parameter packs not expanded with '...':
                         return std::forward<F>(fn)(std::integral_constant<std::size_t, Is>{},
                                ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                    std::forward<Args>(ar)...);
                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~
/local/p4clients/pkgbuild-const/workspace/src/AdnExCyphalEmbeddedTemplateLibrary/include/cetl/pf17/variant.hpp:91:51: note:         'Is'
/local/p4clients/pkgbuild-const/workspace/src/AdnExCyphalEmbeddedTemplateLibrary/include/cetl/pf17/variant.hpp: In static member function 'static decltype(auto) cetl::pf17::detail::var::chronomorphize_impl<std::integer_sequence<long unsigned int, _Idx ...> >::lookup(F&&, std::size_t, Args&& ...)':
/local/p4clients/pkgbuild-const/workspace/src/AdnExCyphalEmbeddedTemplateLibrary/include/cetl/pf17/variant.hpp:93:22: error: expansion pattern '<lambda>' contains no argument packs
                     }...,
                      ^~~ 

Looks like it might be related to these GCC bug reports:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47226
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85305

Link to affected code: https://github.com/OpenCyphal/CETL/blob/main/include/cetl/pf17/variant.hpp#L83-L96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants