Skip to content

Commit f3beed8

Browse files
Copilot feedback
1 parent 9e20649 commit f3beed8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cpp/misra/src/rules/RULE-15-1-4/NonStaticMemberNotInitBeforeUse.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class IncompleteAggregateInit extends LocalVariable, IncompleteInitialization {
194194
/**
195195
* An aggregate created by a new or new[] expression that does not initialize necessary fields.
196196
*
197-
* For examyple, `new Aggregate;` does not zero-initialize members and may be non-compliant, while
197+
* For example, `new Aggregate;` does not zero-initialize members and may be non-compliant, while
198198
* `new Aggregate{};` does zero-initialize members and is compliant.
199199
*/
200200
class IncompleteAggregateNew extends NewOrNewArrayExpr, IncompleteInitialization {

cpp/misra/test/rules/RULE-15-1-4/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ struct Aggregate {
275275
} // namespace std
276276
void useStd() {
277277
// std::array is the only aggregate in the STL according to the spec, but
278-
// we should categorically exclude
278+
// we should categorically exclude types from `std`.
279279
std::array<int, 5> a; // COMPLIANT
280280
std::Aggregate a2; // COMPLIANT
281281
}
@@ -286,7 +286,7 @@ void useUnionAggregate() {
286286
float m2;
287287
};
288288

289-
// Unions are aggregates, but we should not report on them.
289+
// Unions are aggregates, we should still check for `{}`-initialization.
290290
UnionAggregate a; // NON_COMPLIANT
291291
UnionAggregate a2{}; // COMPLIANT
292292
UnionAggregate a3 = {}; // COMPLIANT

0 commit comments

Comments
 (0)