This patch is for discussion.
Currently, the evaluator does not know about static const fields if
the code does not contain a definition (but only a declaration).
For example:
struct C { static const int f = 42; }; int main() { return C::f; // Evaluating C::f does not work here! }
This patch tries to fix that by initializing the varDecl of the static
field with the constant value. This works reasonably well when the
static member is only used as rvalue, but any lvalue usage still does
not work because the static member does not have a memory location.
To fix this properly, do we have to teach the materializer about the
static fields, too? What would be the best way to go about that?