summaryrefslogtreecommitdiffstats
path: root/test/CXX/class/class.friend/p2.cpp
blob: eb5036f812871664fb2e8c05ba894336f4075cc9 (plain)
1
2
3
4
5
6
7
8
9
10
// RUN: %clang_cc1 -fsyntax-only -verify %s

struct B0;

class A {
  friend class B {}; // expected-error {{cannot define a type in a friend declaration}}
  friend int; // expected-warning {{non-class type 'int' cannot be a friend}}
  friend B0; // expected-warning {{must specify 'struct' to befriend}}
  friend class C; // okay
};
OpenPOWER on IntegriCloud