================
@@ -21887,9 +21689,11 @@ ExprResult Sema::CheckPlaceholderExpr(Expr *E) {
   case BuiltinType::ArraySection:
     // If we've already diagnosed something on the array section type, we
     // shouldn't need to do any further diagnostic here.
-    if (!E->containsErrors())
-      Diag(E->getBeginLoc(), diag::err_array_section_use)
-          << cast<ArraySectionExpr>(E)->isOMPArraySection();
+    if (!E->containsErrors()) {
+      if (auto *ASE = dyn_cast<ArraySectionExpr>(E->IgnoreParens()))
----------------
Serosh-commits wrote:

> I don't think it's safe to skip this error at all - we're in an error path 
> and if we skip emitting the error I think it's possible that we'll end up 
> trying to emit code. If you can work out a way to trigger this path we'll 
> need to just adjust the diagnostic we generate, not skip it entirely.

yeah i can go with simple cast with IgnoreParens() so  i think we are not 
skipping the diagnostics and it will emit the error as expected 

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

Reply via email to