]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Fix sve-sizeless-[12].C for C++98
authorAndrew Pinski <quic_apinski@quicinc.com>
Sun, 1 Dec 2024 04:58:14 +0000 (20:58 -0800)
committerAndrew Pinski <quic_apinski@quicinc.com>
Sun, 1 Dec 2024 04:58:14 +0000 (20:58 -0800)
In C++98 `{ a }` for aggregates can only mean constructing by
each element rather than a copy. This adds the expected error
message for SVE vectors for C++98.

Pushed as obvious after a test for aarch64-linux-gnu.

gcc/testsuite/ChangeLog:

* g++.dg/ext/sve-sizeless-1.C: Add error message for line 164
for C++98 only.
* g++.dg/ext/sve-sizeless-2.C: Likewise.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/testsuite/g++.dg/ext/sve-sizeless-1.C
gcc/testsuite/g++.dg/ext/sve-sizeless-2.C

index 0d62bd7f39e9b005eea11ff4bbbb1345b0361478..37bcec1efb9f7f41454f432fd2a45da133184acc 100644 (file)
@@ -161,7 +161,7 @@ statements (int n)
   svint8_t init_sve_sc3 = sve_sc1;
   svint8_t init_sve_sc4 = sve_sh1; // { dg-error {cannot convert 'svint16_t' to 'svint8_t'} }
   svint8_t init_sve_sc5 = {};
-  svint8_t init_sve_sc6 = { sve_sc1 };
+  svint8_t init_sve_sc6 = { sve_sc1 }; // { dg-error {cannot convert 'svint8_t' to 'signed char'} "" { target c++98_only } }
   svint8_t init_sve_sc7 = { sve_sh1 }; // { dg-error {cannot convert 'svint16_t' to 'signed char'} }
   svint32_t init_sve_vc1 = { 0, 1 };
   svint32_t init_sve_vc2 = { 0, bar () };
index 51def2441df9361448a571dbfa0c15824dbca82c..3243a17f60668f3123487459b55b5e91b8807136 100644 (file)
@@ -161,7 +161,7 @@ statements (int n)
   svint8_t init_sve_sc3 = sve_sc1;
   svint8_t init_sve_sc4 = sve_sh1; // { dg-error {cannot convert 'svint16_t' to 'svint8_t'} }
   svint8_t init_sve_sc5 = {};
-  svint8_t init_sve_sc6 = { sve_sc1 };
+  svint8_t init_sve_sc6 = { sve_sc1 }; // { dg-error {cannot convert 'svint8_t' to 'signed char'} "" { target c++98_only } }
   svint8_t init_sve_sc7 = { sve_sh1 }; // { dg-error {cannot convert 'svint16_t' to 'signed char'} }
   svint32_t init_sve_vc1 = { 0, 1 };
   svint32_t init_sve_vc2 = { 0, bar () };