const2.c
来自「用于进行gcc测试」· C语言 代码 · 共 14 行
C
14 行
// { dg-do link }// This test should get a linker error for the reference to A<int>::i.// { dg-error "i" "" { target *-*-* } 0 }template <class T> struct B { static const int i = 3; };template <class T> struct A { static const int i = B<T>::i; };const int *p = &A<int>::i;int main (){ // Examine p to prevent optimising linkers from discarding it. return (p != 0);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?