If you only refer to var inside of C, the compiler does not know whether you mean A::var or B::var and the compiler will tell you that var is ambiguous. Therefore, you have to fully qualify the name when using var.
No merging happens, any instance of C will contain both variables.