Don't allow async (no return) functions that throw exceptions.

This wouldn't work anyway.  Better to catch it early.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665570 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/parse/t_function.h b/compiler/cpp/src/parse/t_function.h
index ed1c73c..74dac63 100644
--- a/compiler/cpp/src/parse/t_function.h
+++ b/compiler/cpp/src/parse/t_function.h
@@ -41,7 +41,12 @@
     name_(name),
     arglist_(arglist),
     xceptions_(xceptions),
-    async_(async) {}
+    async_(async)
+  {
+    if (async_ && !xceptions_->get_members().empty()) {
+      throw std::string("Async methods can't throw exceptions.");
+    }
+  }
 
   ~t_function() {}