friend31.c

来自「Mac OS X 10.4.9 for x86 Source Code gcc」· C语言 代码 · 共 28 行

C
28
字号
// { dg-do compile }// Origin: Ivan Godard <igodard@pacbell.net>// PR c++/15410: Declaration of friend class template with wrong// template parameter.template <typename T, typename U> struct F; // { dg-error "previous declaration" }class W{  template<int i> friend class F;	// { dg-error "template parameter" }  int x;};template <typename T, typename U> struct F{  void Look(W& w) { w.x = 3; }};int main(){  W w;  F<char, bool> f;  f.Look(w);  return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?