https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61661

            Bug ID: 61661
           Summary: [C++11][4.9/4.10 Regression] Bogus error: ‘const
                    Outer::Foo{&Outer::Bar}’ is not a constant expression
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: brooks at gcc dot gnu.org

Google ref: b/15984570

This source:

/// --- cut ---
struct Outer {

  void Bar();

  struct Foo {
    void (Outer::*ptr)() ;
  };

  static constexpr Foo foo = { &Outer::Bar };
};
/// --- cut ---

compiles fine with gcc-4.8 and Clang, fails with gcc-4_9 and current trunk.
Started to fail after r195189 and before r197259 (boundaries are not exact).

./gcc-svn-r211990/bin/g++ -c -std=c++11 -o /tmp/t.o /tmp/t.cc
/tmp/t.cc:9:44: error: ‘const Outer::Foo{&Outer::Bar}’ is not a constant
expression
   static constexpr Foo foo = { &Outer::Bar };
                                            ^

Reply via email to