================
@@ -242,14 +243,37 @@ static const FunctionDecl *resolveMocks(const
FunctionDecl *Func) {
return Func;
}
+static bool isBracedInitListExpr(const Expr *Arg) {
+ Arg = Arg->IgnoreImplicit();
+ // List-initialization can be represented by a list expression itself or by a
+ // list-initialized constructor/cast. Treat all of these as braced-init uses.
+ if (isa<InitListExpr>(Arg))
+ return true;
+ if (const auto *StdInit = dyn_cast<CXXStdInitializerListExpr>(Arg))
+ return isBracedInitListExpr(StdInit->getSubExpr()->IgnoreImplicit());
----------------
localspook wrote:
```suggestion
return isBracedInitListExpr(StdInit->getSubExpr());
```
since the first thing `isBracedInitListExpr` does is call `IgnoreImplicit`
anyway
https://github.com/llvm/llvm-project/pull/180408
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits