Export (0) Print
Expand All
Expand Minimize
0 out of 1 rated this helpful - Rate this topic

Compiler Warning (level 1) C4537

Error Message

'object' : 'operator' applied to non-UDT type

A reference was passed where an object (user-defined type) was expected. A reference is not an object, but inline assembler code is not able to make the distinction. The compiler generates code as though object were an instance.

The following sample generates 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
   */
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.