As the standard says:
The definition for a static data member shall appear in a namespace scope enclosing the member’s class definition.
Also, the definition of static data member is in the scope of a class. So,
int x = 100; //global variable
class StaticMemeberScope
{
static int x;
static int y;
};
int StaticMemeberScope::x =1;
int StaticMemeberScope::y = x + 1; // y =2 (StaticMemeberScope::x, not ::x)