From 4c174428379af308926ec70bc5b58539a1863abf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 15 Apr 2010 13:47:31 +0200 Subject: Implement enum synthesis from union A union which has enumerations with a common base as members can be transformed to an equivalent enumeration. --- tests/dump/driver.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/dump/driver.cxx') diff --git a/tests/dump/driver.cxx b/tests/dump/driver.cxx index 973a30a..2e55e97 100644 --- a/tests/dump/driver.cxx +++ b/tests/dump/driver.cxx @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -571,11 +572,14 @@ main (Int argc, Char* argv[]) // Int i (1); Boolean anon (false); + Boolean enum_synth (false); for (; i < argc; ++i) { if (argv[i] == NarrowString ("--anonymous")) anon = true; + else if (argv[i] == NarrowString ("--enum-synthesis")) + enum_synth = true; else break; } @@ -607,6 +611,14 @@ main (Int argc, Char* argv[]) // // + if (enum_synth) + { + Transformations::EnumSynthesis transf; + transf.transform (*tu, path); + } + + // + // Schema schema; Uses uses; -- cgit v1.1