================
@@ -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:

> Yes! It re-enable diagnostics for ordinary temporary range expressions in 
> C++20, while still keeping raw braced-init-lists excluded.

Ohh, I had a case of code blindness; I misread it as
```cpp
if (Finder->getASTContext().getLangOpts().CPlusPlus20)
  if (isa<CXXStdInitializerListExpr>(E))
    return false;
```
Thank you for the explanation, now it makes sense ^_^
---
As for "don't warn" vs "warn with a different message" on temporaries: if we do 
need to have a design discussion, I think it makes sense to have it now (here 
or under that issue). But also let's wait for @5chmidti's opinion

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