Skip to content

Commit 6890692

Browse files
committed
Fix formatting
1 parent 541aec4 commit 6890692

File tree

4 files changed

+66
-69
lines changed

4 files changed

+66
-69
lines changed

libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.verify.cpp

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,35 @@
1919

2020
struct TestType {};
2121

22-
void test_const_lvalue_cast_request_non_const_lvalue()
23-
{
24-
const std::any a;
25-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
26-
// expected-error@any:* {{drops 'const' qualifier}}
27-
(void)std::any_cast<TestType&>(a); // expected-note {{requested here}}
28-
29-
const std::any a2(42);
30-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
31-
// expected-error@any:* {{drops 'const' qualifier}}
32-
(void)std::any_cast<int&>(a2); // expected-note {{requested here}}
22+
void test_const_lvalue_cast_request_non_const_lvalue() {
23+
const std::any a;
24+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
25+
// expected-error@any:* {{drops 'const' qualifier}}
26+
(void)std::any_cast<TestType&>(a); // expected-note {{requested here}}
27+
28+
const std::any a2(42);
29+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
30+
// expected-error@any:* {{drops 'const' qualifier}}
31+
(void)std::any_cast<int&>(a2); // expected-note {{requested here}}
3332
}
3433

35-
void test_lvalue_any_cast_request_rvalue()
36-
{
37-
std::any a;
38-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
39-
(void)std::any_cast<TestType&&>(a); // expected-note {{requested here}}
34+
void test_lvalue_any_cast_request_rvalue() {
35+
std::any a;
36+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
37+
(void)std::any_cast<TestType&&>(a); // expected-note {{requested here}}
4038

41-
std::any a2(42);
42-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
43-
(void)std::any_cast<int&&>(a2); // expected-note {{requested here}}
39+
std::any a2(42);
40+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
41+
(void)std::any_cast<int&&>(a2); // expected-note {{requested here}}
4442
}
4543

46-
void test_rvalue_any_cast_request_lvalue()
47-
{
48-
std::any a;
49-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
50-
// expected-error@any:* {{non-const lvalue reference to type 'TestType' cannot bind to a temporary}}
51-
(void)std::any_cast<TestType&>(std::move(a)); // expected-note {{requested here}}
44+
void test_rvalue_any_cast_request_lvalue() {
45+
std::any a;
46+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
47+
// expected-error@any:* {{non-const lvalue reference to type 'TestType' cannot bind to a temporary}}
48+
(void)std::any_cast<TestType&>(std::move(a)); // expected-note {{requested here}}
5249

53-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
54-
// expected-error@any:* {{non-const lvalue reference to type 'int' cannot bind to a temporary}}
55-
(void)std::any_cast<int&>(42);
50+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
51+
// expected-error@any:* {{non-const lvalue reference to type 'int' cannot bind to a temporary}}
52+
(void)std::any_cast<int&>(42);
5653
}

libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ struct TestType {};
2828
struct TestType2 {};
2929

3030
void f() {
31-
std::any a;
31+
std::any a;
3232

33-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
34-
(void)std::any_cast<TestType&>(static_cast<std::any const&>(a)); // expected-note {{requested here}}
33+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
34+
(void)std::any_cast<TestType&>(static_cast<std::any const&>(a)); // expected-note {{requested here}}
3535

36-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
37-
(void)std::any_cast<TestType&&>(static_cast<std::any const&>(a)); // expected-note {{requested here}}
36+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
37+
(void)std::any_cast<TestType&&>(static_cast<std::any const&>(a)); // expected-note {{requested here}}
3838

39-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
40-
(void)std::any_cast<TestType2&>(static_cast<std::any const&&>(a)); // expected-note {{requested here}}
39+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
40+
(void)std::any_cast<TestType2&>(static_cast<std::any const&&>(a)); // expected-note {{requested here}}
4141

42-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
43-
(void)std::any_cast<TestType2&&>(static_cast<std::any const&&>(a)); // expected-note {{requested here}}
42+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
43+
(void)std::any_cast<TestType2&&>(static_cast<std::any const&&>(a)); // expected-note {{requested here}}
4444
}

libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,27 @@
3131
#include <any>
3232

3333
struct no_copy {
34-
no_copy() {}
35-
no_copy(no_copy &&) {}
36-
no_copy(no_copy const &) = delete;
34+
no_copy() {}
35+
no_copy(no_copy&&) {}
36+
no_copy(no_copy const&) = delete;
3737
};
3838

3939
struct no_move {
40-
no_move() {}
41-
no_move(no_move&&) = delete;
42-
no_move(no_move const&) {}
40+
no_move() {}
41+
no_move(no_move&&) = delete;
42+
no_move(no_move const&) {}
4343
};
4444

4545
void f() {
46-
std::any a;
47-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
48-
(void)std::any_cast<no_copy>(static_cast<std::any&>(a)); // expected-note {{requested here}}
46+
std::any a;
47+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
48+
(void)std::any_cast<no_copy>(static_cast<std::any&>(a)); // expected-note {{requested here}}
4949

50-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
51-
(void)std::any_cast<no_copy>(static_cast<std::any const&>(a)); // expected-note {{requested here}}
50+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
51+
(void)std::any_cast<no_copy>(static_cast<std::any const&>(a)); // expected-note {{requested here}}
5252

53-
(void)std::any_cast<no_copy>(static_cast<std::any&&>(a)); // OK
53+
(void)std::any_cast<no_copy>(static_cast<std::any&&>(a)); // OK
5454

55-
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
56-
(void)std::any_cast<no_move>(static_cast<std::any&&>(a));
55+
// expected-error-re@any:* {{static assertion failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
56+
(void)std::any_cast<no_move>(static_cast<std::any&&>(a));
5757
}

libcxx/test/std/utilities/any/any.nonmembers/any.cast/reference_types.verify.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,31 @@
1919
#include <any>
2020

2121
void test() {
22-
std::any a = 1;
22+
std::any a = 1;
2323

24-
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
25-
(void)std::any_cast<int&>(&a); // expected-note {{requested here}}
24+
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
25+
(void)std::any_cast<int&>(&a); // expected-note {{requested here}}
2626

27-
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
28-
(void)std::any_cast<int&&>(&a); // expected-note {{requested here}}
27+
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
28+
(void)std::any_cast<int&&>(&a); // expected-note {{requested here}}
2929

30-
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
31-
(void)std::any_cast<int const&>(&a); // expected-note {{requested here}}
30+
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
31+
(void)std::any_cast<int const&>(&a); // expected-note {{requested here}}
3232

33-
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
34-
(void)std::any_cast<int const&&>(&a); // expected-note {{requested here}}
33+
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
34+
(void)std::any_cast<int const&&>(&a); // expected-note {{requested here}}
3535

36-
const std::any& a2 = a;
36+
const std::any& a2 = a;
3737

38-
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
39-
(void)std::any_cast<int &>(&a2); // expected-note {{requested here}}
38+
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
39+
(void)std::any_cast<int&>(&a2); // expected-note {{requested here}}
4040

41-
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
42-
(void)std::any_cast<int&&>(&a2); // expected-note {{requested here}}
41+
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
42+
(void)std::any_cast<int&&>(&a2); // expected-note {{requested here}}
4343

44-
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
45-
(void)std::any_cast<int const&>(&a2); // expected-note {{requested here}}
44+
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
45+
(void)std::any_cast<int const&>(&a2); // expected-note {{requested here}}
4646

47-
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
48-
(void)std::any_cast<int const&&>(&a2); // expected-note {{requested here}}
47+
// expected-error-re@any:* 1 {{static assertion failed{{.*}}_ValueType may not be a reference.}}
48+
(void)std::any_cast<int const&&>(&a2); // expected-note {{requested here}}
4949
}

0 commit comments

Comments
 (0)