summaryrefslogtreecommitdiffstats
path: root/test/CXX/class/class.friend/p2.cpp
blob: 9fe2b17e5049d30633d5c969e1a90d4d8e9fb75f (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-error {{friends can only be classes or functions}}
  friend B0; // expected-error {{must specify 'struct' to befriend}}
  friend class C; // okay
};
OpenPOWER on IntegriCloud