aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authornnorwitz <nnorwitz@8415998a-534a-0410-bf83-d39667b30386>2009-05-06 05:01:46 +0000
committernnorwitz <nnorwitz@8415998a-534a-0410-bf83-d39667b30386>2009-05-06 05:01:46 +0000
commit987a978c3c525cbc796824493436195872b89a0b (patch)
treea5c141e6c25ff8bd7e000185f0b9243719f52fdc /scripts
parente7bb5ededa4df6ec430c1e84154bc01bf84d4ecc (diff)
downloadgoogletest-987a978c3c525cbc796824493436195872b89a0b.tar.gz
googletest-987a978c3c525cbc796824493436195872b89a0b.tar.bz2
googletest-987a978c3c525cbc796824493436195872b89a0b.zip
Issue 44: "const" is missing for const return types
The modifiers (things like const, volatile, etc) were not being added to return types.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generator/cpp/gmock_class.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/generator/cpp/gmock_class.py b/scripts/generator/cpp/gmock_class.py
index f2b3521f..99a89655 100755
--- a/scripts/generator/cpp/gmock_class.py
+++ b/scripts/generator/cpp/gmock_class.py
@@ -54,7 +54,11 @@ def _GenerateMethods(output_lines, source, class_node):
const = 'CONST_'
return_type = 'void'
if node.return_type:
- return_type = node.return_type.name
+ # Add modifier bits like const.
+ modifiers = ''
+ if node.return_type.modifiers:
+ modifiers = ' '.join(node.return_type.modifiers) + ' '
+ return_type = modifiers + node.return_type.name
if node.return_type.pointer:
return_type += '*'
if node.return_type.reference: