[PATCH] D64678: [Sema] Fix -Wuninitialized for struct assignment from GNU C statement expression

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 24 05:16:02 PDT 2019


aaron.ballman accepted this revision.
aaron.ballman added a comment.

LGTM aside from a comment request.



================
Comment at: clang/lib/Sema/SemaDecl.cpp:11258
   // are handled by a dataflow analysis.
-  if (!VDecl->hasLocalStorage() || VDecl->getType()->isRecordType() ||
-      VDecl->getType()->isReferenceType()) {
-    CheckSelfReference(*this, RealDecl, Init, DirectInit);
+  if (getLangOpts().CPlusPlus) {
+    if (!VDecl->hasLocalStorage() || VDecl->getType()->isRecordType() ||
----------------
This should probably have a comment explaining why we only do it in C++ mode.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64678/new/

https://reviews.llvm.org/D64678





More information about the cfe-commits mailing list