From a438a0460aa0def2382691f1de4cbc429beedf81 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Tue, 14 Jan 2025 20:33:50 +0300 Subject: [PATCH] ArgumentParserTypes: implement a workaround for EDG 6 assertion failure While building CMake on EDG 603+-based compiler, such as LCC 1.27.x, an internal assertion failure may be experienced with a message like 'assertion failed at: "il.c", line 15635 in i_copy_dynamic_init'. This commit introduces a workaround that helps avoiding this. Workaround is enabled only for LCC based on this EDG frontend, it is not known if it is needed for any other compilers, since there were none found based on EDG 603 and later and having this bug. --- Source/cmArgumentParserTypes.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/cmArgumentParserTypes.h b/Source/cmArgumentParserTypes.h index 3e0fae4404..e89c94046b 100644 --- a/Source/cmArgumentParserTypes.h +++ b/Source/cmArgumentParserTypes.h @@ -21,6 +21,13 @@ struct Maybe : public std::string template struct MaybeEmpty; +# if defined(__LCC__) && (__EDG_VERSION__ >= 603) +template <> +struct MaybeEmpty> : public std::vector +{ + using std::vector::vector; +}; +# endif template struct MaybeEmpty> : public std::vector {