Accept string literal decay in conditional operator
The cppcoreguidelines-pro-bounds-array-to-pointer-decay check currently accepts: const char *b = i ? "foo" : "foobar"; but not const char *a = i ? "foo" : "bar"; This is because the AST is slightly different in the latter case (see https://godbolt.org/z/MkHVvs). This eliminates the inconsistency by making it accept the latter form as well. Fixes https://github.com/llvm/llvm-project/issues/31155.
Loading
Please sign in to comment