Fixed namespace code generation for C++

The code generator was assuming all declarations for the current
file sit in the same namepace. Now uses the "on demand" namespace
switching we had for the forward declarations.

Also fixed a bug related to namespace lookup.

Change-Id: Ib54a3efbc752cbb9590302fa0707c0c73448db3d
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2016-02-12 16:20:33 -08:00
parent 472fb12273
commit 20c0082ee5
18 changed files with 1000 additions and 223 deletions

View File

@@ -7,7 +7,9 @@
namespace MyGame {
namespace OtherNameSpace {
struct Unused;
} // namespace OtherNameSpace
} // namespace MyGame
@@ -15,9 +17,13 @@ namespace MyGame {
namespace Example {
struct Test;
struct TestSimpleTableWithEnum;
struct Vec3;
struct Stat;
struct Monster;
enum Color {