* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-ptrmem.C
bloba16e5c4591660c2785bce3ce8de81396b8daecf8
1 // { dg-do compile { target c++11 } }
3 struct C { // literal type
4   int m;
5   int n;
6   constexpr C(int m) : m(m), n(-m) {}
7   constexpr bool is_neg() const { return m < 0; }
8 };
10 constexpr bool check1(const C& c, int C:: *pm) { return c.*pm < 0; } // #1
12 constexpr bool check2(const C* pc, bool (C::*pm)() const) { return
13 (pc->*pm)(); } // #2
15 constexpr C c(-1);
17 static_assert(!check1(c, &C::n), "Error");
18 static_assert(check1(c, &C::m), "Error");
20 static_assert(check2(&c, &C::is_neg), "Error");