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

            Bug ID: 60199
           Summary: 'error: field initializer is not constant' error when
                    initializing static member function pointer to a
                    function
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: abigail.buccaneer at gmail dot com

The following code compiles in Clang 3.3, but not GCC 4.8.2:


//---------------------------------------
// g++ -std=c++11 -Wall -Wextra -pedantic 

void f() {}

static constexpr void (*g1)() = &f; // ok
static constexpr void (*g2)() = f; // ok
struct S {
    static constexpr void (*g3)() = &f; // ok
    static constexpr void (*g4)() = f; // error: field initializer is not
constant
};

//---------------------------------------

Reply via email to