[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / gomp / pr29965-8.C
blobb2a35287d8a69edd9bfb712a8d8c3ef375ddcffd
1 // PR middle-end/29965
2 // Test that OpenMP construct bodies which never return don't cause ICEs.
3 // This is invalid code, but we don't emit diagnostics for it, nevertheless
4 // we test that we don't ICE on it.
5 // { dg-do compile }
6 // { dg-options "-O2 -fopenmp" }
8 void
9 foo1 ()
11 #pragma omp sections
12   {
13     throw 0;
14   }
17 void
18 bar1 ()
20 #pragma omp sections
21   {
22 #pragma omp section
23     throw 0;
24 #pragma omp section
25     throw 0;
26   }
29 void
30 foo2 ()
32 #pragma omp sections
33   {
34     ;
35 #pragma omp section
36     throw 0;
37   }
40 void
41 bar2 ()
43 #pragma omp sections
44   {
45 #pragma omp section
46     throw 0;
47 #pragma omp section
48     ;
49   }
52 void
53 foo3 ()
55 #pragma omp parallel sections
56   {
57     throw 0;
58   }
61 void
62 bar3 ()
64 #pragma omp parallel sections
65   {
66 #pragma omp section
67     throw 0;
68 #pragma omp section
69     throw 0;
70   }
73 void
74 foo4 ()
76 #pragma omp parallel sections
77   {
78     ;
79 #pragma omp section
80     throw 0;
81   }
84 void
85 bar4 ()
87 #pragma omp parallel sections
88   {
89 #pragma omp section
90     throw 0;
91 #pragma omp section
92     ;
93   }