This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/81000] New: std::any improvement
- From: "nicolas_daniengels at yahoo dot com.br" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Jun 2017 12:13:11 +0000
- Subject: [Bug libstdc++/81000] New: std::any improvement
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81000
Bug ID: 81000
Summary: std::any improvement
Product: gcc
Version: 5.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: nicolas_daniengels at yahoo dot com.br
Target Milestone: ---
The code:
#if __has_include(<any>)
# include <any>
using namespace std;
#elif __has_include(<experimental/any>)
# include <experimental/any>
using namespace std::experimental;
#endif
int f()
{
any a = 0.7777;
a = 10;
return any_cast<int>(a);
}
Is not optimised away (-O[1, 2, 3]) since was add in back 5.1. Could it be
improved for this trivial case?
Comparative:
https://godbolt.org/g/sfDj0C
Thanks to all contributors of libstdc++!
Nicolas Engels