list(): rely on cmList class

Fixes: #24549
This commit is contained in:
Marc Chevrier
2023-03-31 17:34:11 +02:00
parent 0dcb545602
commit e8c581606d
3 changed files with 321 additions and 847 deletions

View File

@@ -82,7 +82,9 @@ cmList& cmList::filter(cm::string_view pattern, FilterMode mode)
{
cmsys::RegularExpression regex(std::string{ pattern });
if (!regex.is_valid()) {
throw std::invalid_argument(cmStrCat("invalid regex: ", pattern));
throw std::invalid_argument(
cmStrCat("sub-command FILTER, mode REGEX failed to compile regex \"",
pattern, "\"."));
}
auto it = std::remove_if(this->Values.begin(), this->Values.end(),

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@ Call Stack \(most recent call first\):
CMP0121-ERANGE-WARN.cmake:2 \(include\)
CMakeLists.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
.*
CMake Error at CMP0121-ERANGE-Common.cmake:3 \(list\):
list index: (-2147483643|2147483647) out of range \(-5, 4\)
Call Stack \(most recent call first\):