aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land.
LGTM, though you should add a release note. ================ Comment at: clang/lib/Sema/SemaInit.cpp:8057 + const Decl *D = Entity.getDecl(); + const VarDecl *VD = dyn_cast_or_null<VarDecl>(D); + QualType DestType = Entity.getType(); ---------------- ================ Comment at: clang/lib/Sema/SemaInit.cpp:8063 // handled in the Failed() branch above. - QualType DestType = Entity.getType(); - S.Diag(Kind.getLocation(), DiagID) - << DestType << (bool)DestType->getAs<RecordType>() - << FixItHint::CreateInsertion(ZeroInitializationFixitLoc, - ZeroInitializationFixit); + if (!DestType->getAs<RecordType>() && VD && VD->isConstexpr()) { + // Use a more useful diagnostic for constexpr variables. ---------------- ================ Comment at: clang/lib/Sema/SemaInit.cpp:9477 << Entity.getName(); + } else if (const auto *VD = dyn_cast_if_present<VarDecl>(Entity.getDecl()); + VD && VD->isConstexpr()) { ---------------- Oh, neato, I see `dyn_cast_or_null` was deprecated... CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131662/new/ https://reviews.llvm.org/D131662 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits