Fix cyclic reference: frontend -> state -> pp_formatter -> frontend. Now pp_formatter is only valid while frontend is still alive. This should not be problem in practice.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-08-20 14:22:55 -07:00
parent 3f5a2a83cc
commit 7778ae0ade
2 changed files with 3 additions and 7 deletions

View file

@ -792,7 +792,7 @@ public:
};
class pp_formatter_cell : public formatter_cell {
frontend m_frontend;
frontend const & m_frontend;
format pp(expr const & e, options const & opts) {
return pp_fn(m_frontend, opts)(e);

View file

@ -107,13 +107,9 @@ static void tst6() {
std::cout << fmt(env) << "\n";
}
static formatter mk() {
frontend f;
return mk_pp_formatter(f);
}
static void tst7() {
formatter fmt = mk();
frontend f;
formatter fmt = mk_pp_formatter(f);
std::cout << fmt(And(Const("x"), Const("y"))) << "\n";
}