@@ -1458,7 +1458,8 @@ copy_tree_body_r (tree *tp, int *walk_su
|| OMP_CLAUSE_CODE (*tp) == OMP_CLAUSE_DEPEND))
{
tree t = OMP_CLAUSE_DECL (*tp);
- if (TREE_CODE (t) == TREE_LIST
+ if (t
+ && TREE_CODE (t) == TREE_LIST
&& TREE_PURPOSE (t)
&& TREE_CODE (TREE_PURPOSE (t)) == TREE_VEC)
{
@@ -0,0 +1,16 @@
+// PR c++/100957
+// { dg-do compile }
+
+struct S {
+ S ()
+ {
+ #pragma omp for ordered(2)
+ for (int i = 0; i < 32; ++i)
+ for (int j = 0; j < 32; ++j)
+ {
+ #pragma omp ordered depend(source)
+ ;
+ #pragma omp ordered depend(sink: i - 1, j - 1)
+ }
+ }
+};