This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52757] [C++11] A lamba functions is not able to be used as a function pointer when passed as an explicit template argument


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52757

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-28 19:58:41 UTC ---
(In reply to comment #0)
> that this happens because there is no constexpr conversion operator from the
> lambda function type to the corresponding function pointer type 

Is there supposed to be?

"The closure type for a lambda-expression with no lambda-capture has a public
non-virtual non-explicit const conversion function to pointer to function
having the same parameter and return types as the closure type's function call
operator. The value returned by this conversion function shall be the address
of a function that, when invoked, has the same effect as invoking the closure
type's function call operator."

A closure is not literal and its conversion operator isn't constexpr.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]