This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55003] [C++11] Member function pointer not working as constexpr initializer
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 21 Oct 2012 13:36:28 +0000
- Subject: [Bug c++/55003] [C++11] Member function pointer not working as constexpr initializer
- Auto-submitted: auto-generated
- References: <bug-55003-4@http.gcc.gnu.org/bugzilla/>
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.