d46c7078b97f8752af393e56c8fae0a68973b968
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / pr77907.C
1 // PR c++/77907
2 // { dg-do run { target c++11 } }
3 // { dg-options "-O2" }
4
5 struct A {
6 int foo () { return 1; }
7 };
8
9 struct B {
10 using C = int (A::*) ();
11 constexpr explicit B (const C x) : b{x} {}
12 C b;
13 };
14
15 B b{&A::foo};
16
17 int
18 main ()
19 {
20 if (!b.b)
21 __builtin_abort ();
22 }