[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 18 23:01:12 PDT 2023


tbaeder added a comment.

"subobject named 'foo'" sounds a bit weird to me, I'd expect just "subobject 'foo'", but that's just a suggestion and I'll wait for a native spearker to chime in on this.



================
Comment at: clang/lib/AST/Interp/Interp.cpp:373
+                                           const FieldDecl *SubObjDecl) {
+  S.FFDiag(SI, diag::note_constexpr_uninitialized) << SubObjDecl;
+  S.Note(SubObjDecl->getLocation(),
----------------
shafik wrote:
> shafik wrote:
> > Do we need to check that `SubObjDecl` is not `nullptr` ever?
> If we are sure it can never be `nullptr` then we should `assert(SubObjDecl)`
Should never be null here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146358



More information about the cfe-commits mailing list