[config] config_test fails on g++ 4.8/4.9
... due to In file included from ../libs/config/test/config_test.cpp:376:0: ../libs/config/test/boost_no_lambdas.ipp: In function ???int boost_no_cxx11_lambdas::test()???: ../libs/config/test/boost_no_lambdas.ipp:21:4: error: expected primary-expression before ???void??? (void)[](){}; ^ ../libs/config/test/boost_no_lambdas.ipp:21:4: error: expected ???)??? before ???void??? I'm not sure why.
Peter Dimov wrote:
In file included from ../libs/config/test/config_test.cpp:376:0: ../libs/config/test/boost_no_lambdas.ipp: In function 'int boost_no_cxx11_lambdas::test()': ../libs/config/test/boost_no_lambdas.ipp:21:4: error: expected primary-expression before 'void' (void)[](){}; ^
See this PR. [C++11] lambda-expression and explicit type conversion (cast notation) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54891 We can workaround the issue by changing - (void)[](){} to - (void)([](){}) Regards, Michel
Michel Morin wrote:
See this PR. [C++11] lambda-expression and explicit type conversion (cast notation) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54891
Ah, thanks.
We can workaround the issue by changing - (void)[](){} to - (void)([](){})
or to [](){}(); or &*[](){}==&*[](){}; :-)
In file included from ../libs/config/test/config_test.cpp:376:0: ../libs/config/test/boost_no_lambdas.ipp: In function 'int boost_no_cxx11_lambdas::test()': ../libs/config/test/boost_no_lambdas.ipp:21:4: error: expected primary-expression before 'void' (void)[](){}; ^
See this PR. [C++11] lambda-expression and explicit type conversion (cast notation) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54891
We can workaround the issue by changing - (void)[](){} to - (void)([](){})
Is this a corner case - in which case we should change the test case - or should lambda's be disabled with GCC (seems harsh?) - ah I see this is a result of a warning suppression change, I'll change the test to actually make use of the lambda - seems like the test case was too contrived. John.
John Maddock wrote:
Is this a corner case - in which case we should change the test case - or should lambda's be disabled with GCC (seems harsh?) - ah I see this is a result of a warning suppression change, I'll change the test to actually make use of the lambda - seems like the test case was too contrived.
I've sent you a pull request that changes it to [](){}(); (among other things) - which calls the lambda instead of discarding it.
John Maddock wrote:
Is this a corner case - in which case we should change the test case - or should lambda's be disabled with GCC (seems harsh?) - ah I see this is a result of a warning suppression change, I'll change the test to actually make use of the lambda - seems like the test case was too contrived.
Yep, let's not disable lambdas on gcc ;) FYI, we can find gcc's bugs related to lambdas at [meta-bug] lambda expressions https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54367 Similarly we can find gcc's bugs on some specific C++ features such as [meta-bug] constexpr issues https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004 by searching "meta-bug" https://gcc.gnu.org/bugzilla/buglist.cgi?quicksearch=meta-bug Regards, Michel
participants (3)
-
John Maddock
-
Michel Morin
-
Peter Dimov