diff options
-rw-r--r-- | src/parseTools.js | 7 | ||||
-rwxr-xr-x | tests/runner.py | 16 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index ad6f2830..09168179 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -385,7 +385,12 @@ function finalizeParam(param) { if (param.type == 'i64' && I64_MODE == 1) { return parseI64Constant(param.ident); } - return toNiceIdent(param.ident); + var ret = toNiceIdent(param.ident); + if (ret in Variables.globals && Variables.globals[ret].isString) { + ret = "STRING_TABLE." + ret; + } + + return ret; } } diff --git a/tests/runner.py b/tests/runner.py index cf6b4009..6bd8626d 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -3617,6 +3617,22 @@ def process(filename): ''' self.do_run(src, re.sub('(^|\n)\s+', '\\1', expected), post_build=add_pre_run_and_checks) + def test_direct_string_constant_usage(self): + src = ''' + #include <iostream> + template<int i> + void printText( const char (&text)[ i ] ) + { + std::cout << text; + } + int main() + { + printText( "some string constant" ); + return 0; + } + ''' + self.do_run(src, "some string constant") + def test_fs_base(self): Settings.INCLUDE_FULL_LIBRARY = 1 try: |