1.cpp:
static struct SA {
int m=1;
int func() {return m;}
}g;
static void test() {
g.func();
}
2.cpp:
static struct SA {
int m=2;
int func() {return m*m;}
}g;
static void test() {
g.func();
}
(1) Is One Definition Rule violated in such case? (2) If not, then ODR is only violated once SA is referenced somewhere?
struct SAis defined by a different sequence of tokens in different translation units - M.M