C6503

warning C6503: annotation conflict: references may not be marked Null=Yes or Null=Maybe

This warning indicates that Null property is incorrectly used on a reference type. A reference holds the address of an object and must point to a valid object. Because reference types cannot be null, you must correct the error by either removing the Null property or by setting the Null property value to No.

Example

The following code generates this warning:

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
class Point
{
public:
    //  members
};

void f([Pre(Null=Yes)] Point& pt);

To correct this warning, set the Null property to No as shown in the following code:

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;

class Point
{
public:
    //  members
}; 
void f([Pre(Null=No)] Point& pt);

See Also

Other Resources

Annotation Properties