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++/55003] [C++11] Member function pointer not working as constexpr initializer


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

Daniel KrÃgler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #1 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-10-21 13:36:28 UTC ---
The code presented code example seems incomplete, because it is accepted as
written. Here a complete code-example compiled with gcc 4.8.0 20121014
(experimental) using the compiler flags

-Wall -std=c++11 -pedantic

//---------------------
template<typename T>
struct MemberGet{
   static constexpr auto assign_operator =
   static_cast<T & (T::*)(const T &)>(&T::operator=);
};

struct X {};

MemberGet<X> mg;
//---------------------

"3|error: declaration of 'constexpr const auto MemberGet<X>::assign_operator'
has no initializer|"

I agree that this code should be accepted.


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