Skip to content

Commit 5d74c04

Browse files
authored
Fixup test added in #155573 to work when the compiler defaults to C++20. (#156166)
The test added in #155573 assumes the compiler defaults to the current default of C++17. If the compiler is changed to default to C++20, the test fails because the expected warnings about a construct being a C++20 extension are no longer emitted. This change fixes up the test to work in either C++17 or C++20 mode by disabling the warning and removing the check for it as this is not what is being tested here.
1 parent 47ddd94 commit 5d74c04

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/test/AST/ByteCode/vectors.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=expected,both -flax-vector-conversions=none %s
2-
// RUN: %clang_cc1 -verify=ref,both -flax-vector-conversions=none %s
1+
// RUN: %clang_cc1 -Wno-c++20-extensions -fexperimental-new-constant-interpreter -verify=expected,both -flax-vector-conversions=none %s
2+
// RUN: %clang_cc1 -Wno-c++20-extensions -verify=ref,both -flax-vector-conversions=none %s
33

44
typedef int __attribute__((vector_size(16))) VI4;
55
constexpr VI4 A = {1,2,3,4};
@@ -147,7 +147,7 @@ namespace {
147147
namespace Assign {
148148
constexpr int a2() {
149149
VI a = {0, 0, 0, 0};
150-
VI b; // both-warning {{C++20 extension}}
150+
VI b;
151151

152152
b = {1,1,1,1};
153153
return b[0] + b[1] + b[2] + b[3];
@@ -161,7 +161,7 @@ namespace Assign {
161161

162162
constexpr bool invalid() {
163163
v2int16_t a = {0, 0};
164-
v2int_t b; // both-warning {{C++20 extension}}
164+
v2int_t b;
165165
b = a; // both-error {{incompatible type}}
166166

167167
return true;

0 commit comments

Comments
 (0)