Here's a better example:
#include <gdiplus.h>
using namespace Gdiplus;
class CMyColor
{
static const Argb VERY_PALE_BLUE = 0xffeaf2ff;
// Interpret a string as a colour
//
static Color ColorFromString(LPCTSTR lpsz)
{
ASSERT(strlen(lpsz) == 6 && strspn(lpsz, "0123456789ABCDEFabcdef") == 6); // 6 characters, all hex digits
return Color(0xff000000 + strtol(lpsz, NULL, 16)); // ff is opacity
}
};
When the comment at the end is typed, "ff" is underlined as mis-spelled, but also the "ff" at the end of the hex constant is underlined at the same time, as shown. If "ff" in the comment is changed to something else, the "ff" in the constant loses its underlining too.
I suspect that there are two bugs here. One is that VA thinks that "ff" at the end of the constant is a new word (if "2" just before it is changed to "a", this doesn't happen any more). The other is that the "ff" in the comment is somehow remembered and used in a code section.