From: Mark Slee Date: Fri, 1 Feb 2008 01:36:26 +0000 (+0000) Subject: Fix to the throws clause validation X-Git-Tag: 0.2.0~1020 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=f07d48e812e5761239c9d34cae35e52e15d1a99e;p=common%2Fthrift.git 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 0b873866..ffdb2f80 100644 --- a/compiler/cpp/src/thrifty.yy +++ b/compiler/cpp/src/thrifty.yy @@ -766,7 +766,7 @@ Throws: { 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); }