From 8896587faf7b9f0150b930861757edd8a3328628 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Mon, 11 May 2015 10:53:54 -0700 Subject: [PATCH] Fixed schemas inheriting namespace from included schemas. Change-Id: Ib561430b235eddf4bfe20f68409e1dfdb359ef2b Tested: on Linux. --- src/idl_parser.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index 9baf0ff0b..3799fd177 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -1185,6 +1185,8 @@ bool Parser::Parse(const char *source, const char **include_paths, } Expect(';'); } + // Start with a blank namespace just in case this file doesn't have one. + namespaces_.push_back(new Namespace()); // Now parse all other kinds of declarations: while (token_ != kTokenEof) { if (proto_mode_) {