public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60199] New: 'error: field initializer is not constant' error when initializing static member function pointer to a function
@ 2014-02-14 15:49 abigail.buccaneer at gmail dot com
  2014-02-16 17:25 ` [Bug c++/60199] 'error: field initializer is not constant' " daniel.kruegler at googlemail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: abigail.buccaneer at gmail dot com @ 2014-02-14 15:49 UTC (permalink / raw)
  To: gcc-bugs

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
};

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-06  9:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14 15:49 [Bug c++/60199] New: 'error: field initializer is not constant' error when initializing static member function pointer to a function abigail.buccaneer at gmail dot com
2014-02-16 17:25 ` [Bug c++/60199] 'error: field initializer is not constant' " daniel.kruegler at googlemail dot com
2014-06-06  9:49 ` paolo.carlini at oracle dot com
2014-06-06  9:53 ` paolo at gcc dot gnu.org
2014-06-06  9:54 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).