Files
CMake/Tests/CMakeLib
Kyle Edwards e8bd920df1 Tests: Fix reliance on undefined behavior of cm::optional
The test for cm::optional assumed that *opt would return a reference
to a non-constructed object if opt.has_value() is false. However, on
certain systems that build CMake with flags to harden the build,
this condition aborts rather than returning the invalid reference.
Fix this by getting the reference only when the cm::optional is
known to actually have a value.

Fixes: #19964
2019-11-13 13:56:22 -05:00
..