Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

C6504

warning C6504: invalid annotation: property may only be used on values of pointer, pointer-to-member, or array type

This warning indicates the use of a property on an incompatible data type. For more information about data types supported by properties, see Annotation Properties.

The following code generates this warning because the _Null_ property cannot be used on the reference data type.

#include<sal.h>

class Point
{
public:
    //  members
};

void f(_Pre_ _Null_ Point& pt)
{
    // code ...
}

To correct this warning, use the following code:

#include<sal.h>

class Point
{
public:
    //  members
};

void f(_Pre_ _Null_  Point* pt)
{
    // code ...
}

The defective code shown earlier also generates warning C6516 because property conflicts resulted in an invalid annotation.

Show:
© 2015 Microsoft