Fix to the throws clause validation
Summary: Types from external files are not resolved until the program parse pass, not the include one. Therefore, only do full type validation once after all includes have been parsed and external type pointers resolved.
Reviewed By: aditya
Test Plan: build ServiceManager.thrift
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665452 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/thrifty.yy b/compiler/cpp/src/thrifty.yy
index 0b87386..ffdb2f8 100644
--- a/compiler/cpp/src/thrifty.yy
+++ b/compiler/cpp/src/thrifty.yy
@@ -766,7 +766,7 @@
{
pdebug("Throws -> tok_throws ( FieldList )");
$$ = $3;
- if (!validate_throws($$)) {
+ if (g_parse_mode == PROGRAM && !validate_throws($$)) {
yyerror("Throws clause may not contain non-exception types");
exit(1);
}