From: Robert Bradshaw Date: Tue, 21 Aug 2012 07:51:23 +0000 (-0700) Subject: Guard C++ declarations with a directive. X-Git-Tag: 0.17b3~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96616ea937ab710d16330ee6f99672815106d9be;p=platform%2Fupstream%2Fpython-cython.git Guard C++ declarations with a directive. --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index ff3ef5f..ed823b3 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -1174,6 +1174,8 @@ class CppClassNode(CStructOrUnionDefNode, BlockNode): # templates [string] or None def declare(self, env): + if self.visibility != 'extern' and not env.directives['experimental_cpp_class_def']: + error(self.pos, "C++ classes need to be declared extern unless experimental_cpp_class_def enabled") if self.templates is None: template_types = None else: