Please consider the below program:
FILE A.H
template <typename T> struct C { static constexpr int x = 42; };
FILE B.H
#include "A.H"
template <> struct C<int> { static constexpr int x = 43; };
FILE A.CC
#include "A.H"
void a() { std::cout << C<int>::x; }
FILE B.CC
#include "B.H"
void b() { std::cout << C<int>::x; }
FILE MAIN.CC
void a(); void b();
int main() { a(); b(); }
What is the status of this program? Is it ill-formed, ill-formed with no diagnostic required, does it exhibit undefined behaviour, or none of the above (its okay)?
If none of the above, what is the output of the program?
If one of the above, what rule does it violate?
(Also, would the answer be different if B.H contained a partial specialization rather than an explicit specialization?)