From 9c8acbf40e4dc9f926a82f51f4e2acee5d23dc68 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 16 May 2023 16:14:28 +0200 Subject: [PATCH] CMakePM: Fix MSVC assertion with tests/manual/cmakepresets Change-Id: I5f06d69b444e453456f2dd9822006b535d3f7843 Reviewed-by: Alessandro Portale --- src/plugins/cmakeprojectmanager/cmakeproject.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 78b6449a7a9..44ebaff555e 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -115,7 +115,16 @@ Internal::PresetsData CMakeProject::combinePresets(Internal::PresetsData &cmakeP && left.inherits.value() == right.inherits.value(); const bool leftInheritsRight = left.inherits && left.inherits.value().contains(right.name); - if ((left.inherits && !right.inherits) || leftInheritsRight || sameInheritance) + + const bool inheritsGreater = left.inherits && right.inherits + && left.inherits.value().first() + > right.inherits.value().first(); + + const bool noInheritsGreater = !left.inherits && !right.inherits + && left.name > right.name; + + if ((left.inherits && !right.inherits) || leftInheritsRight || sameInheritance + || inheritsGreater || noInheritsGreater) return false; return true; });