================
@@ -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);
----------------
5chmidti wrote:

Didn't try it, but `return false` would be: 'no note' for C++20, `return 
E->isPRValue()` would be 'note for temporaries'.

> I think we will need to suggest a note for these cases

-> unconditional note for temporaries, and instead have a pre-C++20 note and a 
post-C++20 note that suggests the ranges overloads?

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