Googletest export

Use an OrderedDict to store templated_types in the AST so that gmock knows how to properly construct the templated Mock class.

This is necessary for functions that make use of the templated typename as an argument or return type.

PiperOrigin-RevId: 349405731
This commit is contained in:
Abseil Team
2020-12-29 07:26:08 -05:00
committed by Derek Mauro
parent d72813110c
commit 95a9bdd9f9
3 changed files with 27 additions and 7 deletions

View File

@@ -36,6 +36,7 @@ except ImportError:
# Python 2.x
import __builtin__ as builtins
import collections
import sys
import traceback
@@ -1433,7 +1434,7 @@ class AstBuilder(object):
pass # Not needed yet.
def _GetTemplatedTypes(self):
result = {}
result = collections.OrderedDict()
tokens = list(self._GetMatchingChar('<', '>'))
len_tokens = len(tokens) - 1 # Ignore trailing '>'.
i = 0