[clang] [C] Warn on uninitialized const objects (PR #137166)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 24 12:08:48 PDT 2025


================
@@ -6496,6 +6496,17 @@ static bool canPerformArrayCopy(const InitializedEntity &Entity) {
   return false;
 }
 
+static const FieldDecl *GetConstField(const RecordDecl *RD) {
----------------
AaronBallman wrote:

No assertion is possible, `CXXRecordDecl` has bases, `RecordDecl` does not. I mean, I could use `dyn_cast` and go that route, but then the assertion gets awkward because it requires multiple expressions.

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


More information about the cfe-commits mailing list