steven.zhang added a comment. In D106431#2892866 <https://reviews.llvm.org/D106431#2892866>, @MTC wrote:
> In D106431#2892859 <https://reviews.llvm.org/D106431#2892859>, @whisperity > wrote: > >> Is this the right decision to make, conceptually? It will leave the variable >> uninitialised still, and reading such an uninit variable is still an issue, >> even if it is an enum. > > Yeah, that's right. However, it's much more difficult to give enum an initial > value than an integer. > >> Could we consider the alternative of warning the user about the >> uninitialized variable, just not offering an automatic (and potentially bad >> / incorrect) fix? > > Make sense, we (ByteDance) are also hesitating whether we should provide > automatic repair for uninitialized variables, because automatic fix may > change the program semantics. This is the same as what we did for integer in essential. We are changing an uninitialized value to the default one, which makes sense as uninitialized means it could be anything. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106431/new/ https://reviews.llvm.org/D106431 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits