view gcc/testsuite/g++.dg/template/pr59930-1.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++/59930

namespace N {
  template<typename T> class A {
    // The injected name is N::B, because we don;t look outside of N
    template<typename U> friend struct B;
  private:
    int n; // { dg-message "declared private here" }
  public:
    A (int);
  };
}

template<typename T> struct B {
  int f(N::A<int> ai) { return ai.n; } // { dg-error "is private" }
};

int k = B<int>().f(0);