diff --git a/regression-tests/test-results/version b/regression-tests/test-results/version index 83f6b9882..905d9120c 100644 --- a/regression-tests/test-results/version +++ b/regression-tests/test-results/version @@ -1,5 +1,5 @@ -cppfront compiler v0.3.0 Build 8C17:1632 +cppfront compiler v0.3.0 Build 8C18:0609 Copyright(c) Herb Sutter All rights reserved SPDX-License-Identifier: CC-BY-NC-ND-4.0 diff --git a/source/build.info b/source/build.info index 9e75a0fb3..474b47ca4 100644 --- a/source/build.info +++ b/source/build.info @@ -1 +1 @@ -"8C17:1632" \ No newline at end of file +"8C18:0609" \ No newline at end of file diff --git a/source/lex.h b/source/lex.h index 5e8605d27..b320ae390 100644 --- a/source/lex.h +++ b/source/lex.h @@ -427,11 +427,16 @@ auto expand_string_literal( // Then put interpolated chunk into ret auto chunk = std::string{text.substr(open, pos - open)}; - { // unescape chunk string - auto last_it = std::remove_if(std::begin(chunk), std::end(chunk), [escape = false](const auto& e) mutable { - escape = !escape && e == '\\'; - return escape; - }); + { // unescape chunk string + auto last_it = std::remove_if( + std::begin(chunk), + std::end(chunk), + [escape = false, prev = ' '](const auto& e) mutable { + escape = !escape && prev != '\'' && e == '\\'; + prev = e; + return escape; + } + ); chunk.erase(last_it, std::end(chunk)); }