diag0165.c

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 48 行

C
48
字号
// check that referencing works for functions
// check that referencing works for mem-initialzer optimized away
// check that mem-initializers are analyzed when optimized away
 
typedef void (*FunctionType)(int CallReason); 
 
int Reason; 
 
static void Y(int CallReason) 
{ 
    Reason = CallReason; 
} 
static void Z(int CallReason) 
{ 
    Reason = CallReason; 
} 
 
FunctionType X(int CallReason) 
{ 
    return (CallReason ? Z : Y); // W014: Z/Y unrefered ? 
} 
 
struct A {}; 
struct B : public A { B(const A&); }; 
B::B(const A& a) : A(a) {}  


struct S {};

struct T : S
{
    T();
    T( const S& );
    T( S& );
};

T::T( const S& s ) : S(s)
{
}

T::T( S& s ) : S( 987 )
{
}

T::T() : S( 8765 )
{
}

⌨️ 快捷键说明

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