================
@@ -35,6 +35,13 @@ AST_MATCHER_P(Stmt, nextStmt, 
ast_matchers::internal::Matcher<Stmt>,
 
   return InnerMatcher.matches(**I, Finder, Builder);
 }
+
+AST_MATCHER(Expr, isUnsupportedRangeInit) {
+  const Expr *E = Node.IgnoreParenImpCasts();
+  if (Finder->getASTContext().getLangOpts().CPlusPlus20)
+    return isa<CXXStdInitializerListExpr>(E);
----------------
localspook wrote:

In my understanding, and correct me if I'm wrong: we don't want the check to 
warn on a for-range loop over a raw initializer list in *any* language mode. 
It's what the current tests assert. But here the exclusion is limited to C++20 
and up, as if we *did* want the check to warn in pre-C++20. So is this 
condition doing anything? :thinking:

https://github.com/llvm/llvm-project/pull/185791
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to