This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55159] New: pythy constexpr auto lambda pointer has no initializer
- From: "supercilious.dude at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Nov 2012 00:33:27 +0000
- Subject: [Bug c++/55159] New: pythy constexpr auto lambda pointer has no initializer
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55159
Bug #: 55159
Summary: pythy constexpr auto lambda pointer has no initializer
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: supercilious.dude@gmail.com
Pythy (http://pfultz2.github.com/Pythy/) does something akin to:
template <typename T>
typename std::remove_reference<T>::type *addr(T &&t)
{
return &t;
}
template <class T0, class T1>
struct min_t
{
constexpr static auto *f =
false ? addr([](T0 x, T1 y){ return x < y ? x : y; }) : nullptr;
};
Which gcc (4.7.2 and 4.8.0 git master) cannot evaluate.
clang and visual studio 2012 work fine.
I know this is not strictly needed by gcc 4.8 since it has deduced auto without
the late specifier (which the other compilers lack), but its highly convenient
to have pythy work on all c++11 compilers.