view gcc/testsuite/g++.dg/cpp0x/constexpr-memfn1.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 84e7813d76e9
children
line wrap: on
line source

// PR c++/48296
// { dg-do compile { target c++11 } }

struct X
{
  constexpr X() { }
  constexpr X f(X x) { return x; }
  constexpr X g(X x);
};

constexpr X X::g(X x) { return x; }

struct Y
{
  Y() { }
  constexpr Y f(Y y) { return y; }  // { dg-error "constexpr" }
  static constexpr Y g(Y y) { return y; } // { dg-error "constexpr" }
};