编译器警告(等级 1)C4537

“object”:“operator”应用于非 UDT 类型

备注

在需要对象(用户定义类型)的位置传递了一个引用。 引用不是对象,但内联汇编程序代码无法区分。 编译器生成代码,就像对象是一个实例一样

示例

以下示例生成 C4537,并演示如何修复此错误:

// C4537.cpp
// compile with: /W1 /c
// processor: x86
struct S {
    int member;
};

void f1(S &s) {
    __asm mov eax, s.member;   // C4537
    // try the following code instead
    // or, make the declaration "void f1(S s)"
    /*
    mov eax, s
    mov eax, [eax]s.member
    */
}