================
@@ -54,31 +56,43 @@ static bool shouldBeDefaultMemberInitializer(const Expr
*Value) {
}
namespace {
+
AST_MATCHER_P(FieldDecl, indexNotLessThan, unsigned, Index) {
return Node.getFieldIndex() >= Index;
}
+
+enum class AssignedLevel { None, Assigned, UnsafetyAssigned };
+
} // namespace
// Checks if Field is initialised using a field that will be initialised after
// it.
// TODO: Probably should guard against function calls that could have side
// effects or if they do reference another field that's initialized before this
// field, but is modified before the assignment.
-static bool isSafeAssignment(const FieldDecl *Field, const Expr *Init,
- const CXXConstructorDecl *Context) {
+static AssignedLevel isSafeAssignment(const FieldDecl *Field, const Expr *Init,
+ const CXXConstructorDecl *Context,
+ AssignedLevel HistoryLevel) {
+ if (HistoryLevel == AssignedLevel::UnsafetyAssigned)
+ return AssignedLevel::UnsafetyAssigned;
+ if (Field->getType()->isReferenceType() &&
----------------
PiotrZSL wrote:
Read a CanonicalType here, teference could be from template, or from a typedef.
https://github.com/llvm/llvm-project/pull/70316
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits