Fix to the throws clause validation
authorMark Slee <mcslee@apache.org>
Fri, 1 Feb 2008 01:36:26 +0000 (01:36 +0000)
committerMark Slee <mcslee@apache.org>
Fri, 1 Feb 2008 01:36:26 +0000 (01:36 +0000)
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

compiler/cpp/src/thrifty.yy

index 0b87386..ffdb2f8 100644 (file)
@@ -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);
       }