📄 friend2.c
字号:
// { dg-do run }// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>// PR c++/12370// Wrong code because of the friend declarationtemplate <typename T> struct A{ T x; A(T t) : x(t) {} friend A<int> foo (const A<unsigned>&);};A<int> foo (const A<unsigned>& a){ A<int> res(a.x); return res;}int main(){ return foo(A<unsigned>(0)).x;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -