diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-11-13 18:52:48 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2019-11-13 18:56:22 (GMT) |
commit | e8bd920df1c149310fc72f2c7e8d359b477ce42f (patch) | |
tree | dbdab5c370a7b544af607f8764598ee6a2b7d545 /.hooks-config | |
parent | 842605341a6d1c3ca4fe4650f0f1572631cfc6a5 (diff) | |
download | CMake-e8bd920df1c149310fc72f2c7e8d359b477ce42f.zip CMake-e8bd920df1c149310fc72f2c7e8d359b477ce42f.tar.gz CMake-e8bd920df1c149310fc72f2c7e8d359b477ce42f.tar.bz2 |
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
Diffstat (limited to '.hooks-config')
0 files changed, 0 insertions, 0 deletions