================
@@ -122,7 +122,10 @@ void 
UseDesignatedInitializersCheck::registerMatchers(MatchFinder *Finder) {
   Finder->addMatcher(
       initListExpr(
           hasType(cxxRecordDecl(RestrictToPODTypes ? isPOD() : isAggregate(),
-                                unless(HasBaseWithFields))
+                                unless(anyOf(HasBaseWithFields,
+                                             IgnoreSingleElementAggregates
+                                                 ? hasName("::std::array")
----------------
carlosgalvezp wrote:

The condition seem wrong? "If `IgnoreSingleElementAggregates` is true, then 
ignore `std::array`. Shouldn't it be the other way around?

Regardless, I believe we want to always ignore `std::array`, regardless of 
`IgnoreSingleElementAggregates`, since the private member is never intended to 
be used by the caller. 

So I would just simplify to `unless(anyOf(HasBaseWithFields, 
hasName("::std::array")))

https://github.com/llvm/llvm-project/pull/134774
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to