diff --git a/src/regex_impl.cc b/src/regex_impl.cc index c5d755ac..b2b485fa 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -1241,17 +1241,14 @@ namespace template struct TestVM : CompiledRegex, ThreadedRegexVM { - using VMType = ThreadedRegexVM; - - TestVM(StringView re, bool dump = false) - : CompiledRegex{compile_regex(re, mode & RegexMode::Forward ? - RegexCompileFlags::None : RegexCompileFlags::Backward)}, - VMType{(const CompiledRegex&)*this} - { if (dump) puts(dump_regex(*this).c_str()); } + TestVM(StringView re) + : CompiledRegex{compile_regex(re, mode & RegexMode::Forward ? RegexCompileFlags::None : RegexCompileFlags::Backward)}, + TestVM::ThreadedRegexVM{static_cast(*this)} + {} bool exec(StringView re, RegexExecFlags flags = RegexExecFlags::None) { - return VMType::exec(re.begin(), re.end(), re.begin(), re.end(), flags); + return TestVM::ThreadedRegexVM::exec(re.begin(), re.end(), re.begin(), re.end(), flags); } }; }