C1050: Friend must be a class or a function

[ERROR]

Description

The friend specifier can only be used for classes (or structures or unions) and functions.

Example
  typedef int I;

  
  struct A {

  
    friend I;  // illegal

  
  };

  
Tips

Use the friend specifier only for classes (or structures or unions) and functions.