view gcc/testsuite/g++.dg/cpp0x/pr62101.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

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

struct X
{
  friend void g(X, int) = 0; // { dg-error "15:initializer specified for friend function" }
  friend void g(X, int) = default; // { dg-error "cannot be defaulted" }
  // { dg-prune-output "note" }
  friend void f(X, int) = delete;
  friend void f(X, double) {}
};

struct Y;
void g(Y, int);
void g(Y, double);

struct Y
{
  // { dg-prune-output "note" }
  friend void g(Y, int) = delete;
  friend void g(Y, double) {}
};

int main()
{
  X x;
  f(x, 5.0);
  f(x, 5); // { dg-error "use of deleted function" }
  Y y;
  g(y, 5.0);
  g(y, 5); // { dg-error "use of deleted function" }
}