Fix an odr violation in ranges.h (#2483)

* Add a testcase demonstrating ODR violation in ranges.h

* Fix ODR violation in ranges.h

* Fix comments

Co-authored-by: Pierre-Antoine Lacaze <pa.lacaze@gmail.com>
This commit is contained in:
Pierre-Antoine LacazeandPierre-Antoine Lacaze authored and GitHub committed 2021-09-02 08:47:44 -07:00
1 parent ee0659f8b6
commit d58d19ba32
3 files changed
+21 -2

No files matched your search

+1 -1
View File
@@ -437,7 +437,7 @@ auto find_escape(const Char* begin, const Char* end)
return {begin, nullptr, 0};
}
auto find_escape(const char* begin, const char* end)
inline auto find_escape(const char* begin, const char* end)
-> find_escape_result<char> {
if (!is_utf8()) return find_escape<char>(begin, end);
auto result = find_escape_result<char>{end, nullptr, 0};