aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/generator/cpp/ast.py
diff options
context:
space:
mode:
authorkosak <kosak@google.com>2014-11-17 02:49:22 +0000
committerkosak <kosak@google.com>2014-11-17 02:49:22 +0000
commit61adbcc5c6b8e0385e3e2bf4262771d20a375002 (patch)
tree59e9d99433365685738be11c4dda1b1352260d6a /scripts/generator/cpp/ast.py
parent055b6b17d2354691af4b20f035f36c134fba2ac9 (diff)
downloadgoogletest-61adbcc5c6b8e0385e3e2bf4262771d20a375002.tar.gz
googletest-61adbcc5c6b8e0385e3e2bf4262771d20a375002.tar.bz2
googletest-61adbcc5c6b8e0385e3e2bf4262771d20a375002.zip
Add support for C++11 explicitly defaulted and deleted special member functions in the gmock generator.
Diffstat (limited to 'scripts/generator/cpp/ast.py')
-rwxr-xr-xscripts/generator/cpp/ast.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/generator/cpp/ast.py b/scripts/generator/cpp/ast.py
index 9504cee5..201bf3a2 100755
--- a/scripts/generator/cpp/ast.py
+++ b/scripts/generator/cpp/ast.py
@@ -1081,10 +1081,17 @@ class AstBuilder(object):
body = None
if token.name == '=':
token = self._GetNextToken()
- assert token.token_type == tokenize.CONSTANT, token
- assert token.name == '0', token
- modifiers |= FUNCTION_PURE_VIRTUAL
- token = self._GetNextToken()
+
+ if token.name == 'default' or token.name == 'delete':
+ # Ignore explicitly defaulted and deleted special members
+ # in C++11.
+ token = self._GetNextToken()
+ else:
+ # Handle pure-virtual declarations.
+ assert token.token_type == tokenize.CONSTANT, token
+ assert token.name == '0', token
+ modifiers |= FUNCTION_PURE_VIRTUAL
+ token = self._GetNextToken()
if token.name == '[':
# TODO(nnorwitz): store tokens and improve parsing.