aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2021-04-27 11:00:53 -0600
committerMartin Sebor <msebor@redhat.com>2021-04-27 11:03:08 -0600
commit2ae2a45c287d254c2890feff2cca46ed2ddb06ca (patch)
treeee48ac8cf6b222613efb6069c89097d3695b9054 /gcc
parentf82658338756fe9a38a728aa542d786a0e889e21 (diff)
downloadgcc-2ae2a45c287d254c2890feff2cca46ed2ddb06ca.zip
gcc-2ae2a45c287d254c2890feff2cca46ed2ddb06ca.tar.gz
gcc-2ae2a45c287d254c2890feff2cca46ed2ddb06ca.tar.bz2
Remove malformed dg-warning directives.
gcc/testsuite/ChangeLog: PR testsuite/100272 * g++.dg/ext/flexary13.C: Remove malformed directives.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/ext/flexary13.C24
1 files changed, 10 insertions, 14 deletions
diff --git a/gcc/testsuite/g++.dg/ext/flexary13.C b/gcc/testsuite/g++.dg/ext/flexary13.C
index f0603f9..1acfa2e 100644
--- a/gcc/testsuite/g++.dg/ext/flexary13.C
+++ b/gcc/testsuite/g++.dg/ext/flexary13.C
@@ -17,44 +17,40 @@ int32_t i = 12345678;
int main ()
{
{
+ // OK. Does not assign any elements to flexible array.
Ax s = { 0 };
ASSERT (s.n == 0);
}
{
- static Ax s =
- { 0, { } }; // dg-warning "initialization of a flexible array member" }
+ // OK only for statically allocated objects, otherwise error.
+ static Ax s = { 0, { } };
ASSERT (s.n == 0);
}
{
- static Ax s =
- { 1, { 2 } }; // dg-warning "initialization of a flexible array member" }
+ static Ax s = { 1, { 2 } };
ASSERT (s.n == 1 && s.a [0] == 2);
}
{
- static Ax s =
- { 2, { 3, 4 } }; // dg-warning "initialization of a flexible array member" }
+ static Ax s = { 2, { 3, 4 } };
ASSERT (s.n = 2 && s.a [0] == 3 && s.a [1] == 4);
}
{
- static Ax s =
- { 123, i }; // dg-warning "initialization of a flexible array member" }
+ static Ax s = { 123, i };
ASSERT (s.n == 123 && s.a [0] == i);
}
{
- static Ax s =
- { 456, { i } }; // dg-warning "initialization of a flexible array member" }
+ static Ax s = { 456, { i } };
ASSERT (s.n == 456 && s.a [0] == i);
}
{
int32_t j = i + 1, k = j + 1;
- static Ax s =
- { 3, { i, j, k } }; // dg-warning "initialization of a flexible array member" }
+ static Ax s = { 3, { i, j, k } };
ASSERT (s.n == 3 && s.a [0] == i && s.a [1] == j && s.a [2] == k);
}
{
- AAx s =
- { 1, { 2 } }; // dg-warning "initialization of a flexible array member" }
+ // OK. Does not assign any elements to flexible array.
+ AAx s = { 1, { 2 } };
ASSERT (s.i == 1 && s.ax.n == 2);
}
}