Skip to content

Commit 324fc76

Browse files
committed
Add comment on AggregateUnsafeMembers
The aggregate test case generates an AST without any ctor and thus without any ctor initializers, inlcuding no CXXDefaultInitExpr.
1 parent 0ba604e commit 324fc76

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/test/SemaCXX/warn-unsafe-buffer-usage-function-attr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ struct SubclassUnsafeMembers : public UnsafeMembers {
142142
{}
143143
};
144144

145+
// Without an explicit constructor, there is no CXXDefaultInitExpr to anchor on
146+
// in matchers.
145147
struct AggregateUnsafeMembers {
146148
UnsafeMembers f1;
147149
UnsafeMembers f2{3}; // expected-warning{{function introduces unsafe buffer manipulation}}

0 commit comments

Comments
 (0)