[clang-tools-extra] [clang-tidy] Ignore unevaluated context in bugprone-optional-value-conversion (PR #90410)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Wed May 8 12:37:46 PDT 2024


PiotrZSL wrote:

@5chmidti 
I did some testing with this. And in example that you provided there is no issue.
This is because if optional will be uninitialized, then this code won't compile regardless if .value() or operator * is used.
Compiler will simply complain that expression is not constexpr.

When used normally, you will get undefined behavior or exception.

https://github.com/llvm/llvm-project/pull/90410


More information about the cfe-commits mailing list