Skip to content

Commit 55f1846

Browse files
author
Jenkins
committed
merge main into amd-staging
Change-Id: I8a3e8948763b7a20aa928f817aaabc93823681ea
2 parents 799be2e + 0fc8fc7 commit 55f1846

File tree

86 files changed

+2012
-1740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2012
-1740
lines changed

clang/test/CXX/drs/cwg0xx.cpp

Lines changed: 79 additions & 78 deletions
Large diffs are not rendered by default.

clang/test/CXX/drs/cwg10xx.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// RUN: %clang_cc1 -std=c++17 %s -verify=expected,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
55
// RUN: %clang_cc1 -std=c++20 %s -verify=expected,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
66
// RUN: %clang_cc1 -std=c++23 %s -verify=expected,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
7+
// RUN: %clang_cc1 -std=c++2c %s -verify=expected,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
78

89
namespace std {
910
__extension__ typedef __SIZE_TYPE__ size_t;
@@ -12,7 +13,7 @@ namespace std {
1213
const T *p; size_t n;
1314
initializer_list(const T *p, size_t n);
1415
};
15-
}
16+
} // namespace std
1617

1718
namespace cwg1004 { // cwg1004: 5
1819
template<typename> struct A {};
@@ -43,7 +44,7 @@ namespace cwg1004 { // cwg1004: 5
4344
// expected-error@-1 {{is a constructor name}}
4445
// expected-note@#cwg1004-t {{in instantiation of default argument}}
4546
Third<A<int> > t; // #cwg1004-t
46-
}
47+
} // namespace cwg1004
4748

4849
namespace cwg1042 { // cwg1042: 3.5
4950
#if __cplusplus >= 201402L
@@ -58,7 +59,7 @@ namespace cwg1042 { // cwg1042: 3.5
5859
// list in this mode.
5960
using foo [[]] = int;
6061
#endif
61-
}
62+
} // namespace cwg1042
6263

6364
namespace cwg1048 { // cwg1048: 3.6
6465
struct A {};
@@ -76,7 +77,7 @@ namespace cwg1048 { // cwg1048: 3.6
7677
}
7778
} (0);
7879
#endif
79-
}
80+
} // namespace cwg1048
8081

8182
namespace cwg1054 { // cwg1054: no
8283
// FIXME: Test is incomplete.
@@ -89,7 +90,7 @@ namespace cwg1054 { // cwg1054: no
8990
a;
9091
// expected-warning@-1 {{expression result unused; assign into a variable to force a volatile load}}
9192
}
92-
}
93+
} // namespace cwg1054
9394

9495
namespace cwg1070 { // cwg1070: 3.5
9596
#if __cplusplus >= 201103L
@@ -108,4 +109,4 @@ namespace cwg1070 { // cwg1070: 3.5
108109
};
109110
C c = {};
110111
#endif
111-
}
112+
} // namespace cwg1070

clang/test/CXX/drs/cwg118.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
// RUN: %clang_cc1 -triple x86_64-linux -std=c++98 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
22
// RUN: %clang_cc1 -triple x86_64-linux -std=c++11 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
33
// RUN: %clang_cc1 -triple x86_64-linux -std=c++14 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
4-
// RUN: %clang_cc1 -triple x86_64-linux -std=c++1z %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
4+
// RUN: %clang_cc1 -triple x86_64-linux -std=c++17 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
5+
// RUN: %clang_cc1 -triple x86_64-linux -std=c++20 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
6+
// RUN: %clang_cc1 -triple x86_64-linux -std=c++23 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
7+
// RUN: %clang_cc1 -triple x86_64-linux -std=c++2c %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
8+
59

610
// cwg118: yes
711

clang/test/CXX/drs/cwg11xx.cpp

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
// RUN: %clang_cc1 -std=c++11 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
33
// RUN: %clang_cc1 -std=c++14 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
44
// RUN: %clang_cc1 -std=c++17 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
5-
// RUN: %clang_cc1 -std=c++2a %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
5+
// RUN: %clang_cc1 -std=c++20 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
6+
// RUN: %clang_cc1 -std=c++23 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
7+
// RUN: %clang_cc1 -std=c++2c %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
68

79
namespace cwg1110 { // cwg1110: 3.1
810
#if __cplusplus >= 201103L
@@ -19,7 +21,7 @@ decltype(return_T<B<int>>())* b;
1921
#endif
2022
} // namespace cwg1110
2123

22-
namespace cwg1111 { // cwg1111: 3.2
24+
namespace cwg1111 { // cwg1111: partial
2325
namespace example1 {
2426
template <typename> struct set; // #cwg1111-struct-set
2527

@@ -57,6 +59,48 @@ void baz() {
5759
a.operator A();
5860
}
5961
} // namespace example2
62+
63+
namespace example3 {
64+
struct A {
65+
operator int();
66+
} a;
67+
void foo() {
68+
typedef int T;
69+
a.operator T(); // T is found using unqualified lookup
70+
// after qualified lookup in A fails.
71+
}
72+
} // namespace example3
73+
74+
namespace example4 {
75+
struct A {
76+
typedef int T; // #cwg1111-A-T
77+
operator T();
78+
};
79+
struct B : A {
80+
operator T();
81+
} b;
82+
void foo() {
83+
b.A::operator T(); // FIXME: qualified lookup should find T in A.
84+
// expected-error@-1 {{unknown type name 'T'}}
85+
// expected-note@#cwg1111-A-T {{'A::T' declared here}}
86+
}
87+
} // namespace example4
88+
89+
namespace example5 {
90+
template <class T1> struct A {
91+
operator T1();
92+
};
93+
template <class T2> struct B : A<T2> {
94+
operator T2();
95+
void foo() {
96+
// In both cases, during instantiation, qualified lookup for T2 wouldn't be able
97+
// to find anything, so T2 has to be found by unqualified lookup.
98+
// After that, 'operator T2()' is found in A<T2> by qualfied lookup.
99+
T2 a = A<T2>::operator T2();
100+
T2 b = ((A<T2> *)this)->operator T2();
101+
}
102+
};
103+
} // namespace example5
60104
} // namespace cwg1111
61105

62106
namespace cwg1113 { // cwg1113: partial
@@ -84,6 +128,6 @@ namespace cwg1113 { // cwg1113: partial
84128
extern "C" void f();
85129
}
86130
void g() { f(); }
87-
}
131+
} // namespace cwg1113
88132

89133
// cwg1150: na

clang/test/CXX/drs/cwg12xx.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// RUN: %clang_cc1 -std=c++17 %s -verify=expected,since-cxx17,since-cxx14,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
55
// RUN: %clang_cc1 -std=c++20 %s -verify=expected,since-cxx17,since-cxx14,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
66
// RUN: %clang_cc1 -std=c++23 %s -verify=expected,since-cxx17,since-cxx14,since-cxx11,since-cxx23 -fexceptions -fcxx-exceptions -pedantic-errors
7+
// RUN: %clang_cc1 -std=c++2c %s -verify=expected,since-cxx17,since-cxx14,since-cxx11,since-cxx23 -fexceptions -fcxx-exceptions -pedantic-errors
78

89
// cwg1200: na
910

@@ -29,10 +30,10 @@ namespace cwg1213 { // cwg1213: 7
2930
using U = decltype(V4Int()[0]);
3031
using U = decltype(EV4Int()[0]);
3132
#endif
32-
}
33+
} // namespace cwg1213
3334

34-
#if __cplusplus >= 201103L
3535
namespace cwg1223 { // cwg1223: 17
36+
#if __cplusplus >= 201103L
3637
struct M;
3738
template <typename T>
3839
struct V;
@@ -82,12 +83,11 @@ void g() {
8283
sizeof(auto () -> C[1]);
8384
// since-cxx11-error@-1 {{function cannot return array type 'C[1]' (aka 'cwg1223::BB[1]')}}
8485
}
85-
86-
}
8786
#endif
87+
} // namespace cwg1223
8888

89-
#if __cplusplus >= 201103L
9089
namespace cwg1227 { // cwg1227: 3.0
90+
#if __cplusplus >= 201103L
9191
template <class T> struct A { using X = typename T::X; };
9292
// since-cxx11-error@-1 {{type 'int' cannot be used prior to '::' because it has no members}}
9393
// since-cxx11-note@#cwg1227-g {{in instantiation of template class 'cwg1227::A<int>' requested here}}
@@ -101,8 +101,8 @@ void h() {
101101
f<int>(0); // OK, substituting return type causes deduction to fail
102102
g<int>(0); // #cwg1227-g-int
103103
}
104-
}
105104
#endif
105+
} // namespace cwg1227
106106

107107
namespace cwg1250 { // cwg1250: 3.9
108108
struct Incomplete;
@@ -114,7 +114,7 @@ struct Base {
114114
struct Derived : Base {
115115
virtual Incomplete *meow();
116116
};
117-
}
117+
} // namespace cwg1250
118118

119119
namespace cwg1265 { // cwg1265: 5
120120
#if __cplusplus >= 201103L
@@ -134,7 +134,7 @@ namespace cwg1265 { // cwg1265: 5
134134
auto k(), l();
135135
// since-cxx14-error@-1 {{function with deduced return type must be the only declaration in its group}}
136136
#endif
137-
}
137+
} // namespace cwg1265
138138

139139
// cwg1291: na
140140

@@ -161,5 +161,4 @@ namespace cwg1295 { // cwg1295: 4
161161
using T = decltype(true ? other : x.bitfield);
162162
using T = unsigned;
163163
#endif
164-
}
165-
164+
} // namespace cwg1295

clang/test/CXX/drs/cwg13xx.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ namespace std {
1414
size_t n;
1515
initializer_list(const T*, size_t);
1616
};
17-
}
17+
} // namespace std
1818

19-
#if __cplusplus >= 201103L
2019
namespace cwg1305 { // cwg1305: 3.0
20+
#if __cplusplus >= 201103L
2121
struct Incomplete; // #cwg1305-Incomplete
2222
struct Complete {};
2323

2424
int incomplete = alignof(Incomplete(&)[]);
2525
// since-cxx11-error@-1 {{invalid application of 'alignof' to an incomplete type 'Incomplete'}}
2626
// since-cxx11-note@#cwg1305-Incomplete {{forward declaration of 'cwg1305::Incomplete'}}
2727
int complete = alignof(Complete(&)[]);
28-
}
2928
#endif
29+
} // namespace cwg1305
3030

3131
namespace cwg1307 { // cwg1307: 14
3232
#if __cplusplus >= 201103L
@@ -150,7 +150,7 @@ namespace cwg1310 { // cwg1310: 5
150150
}
151151
template void wt_test<W<int> >(); // #cwg1310-W-int
152152
template void wt_test_good<W<int> >();
153-
}
153+
} // namespace cwg1310
154154

155155
namespace cwg1315 { // cwg1315: partial
156156
template <int I, int J> struct A {};
@@ -182,7 +182,7 @@ namespace cwg1315 { // cwg1315: partial
182182
template <typename T, int I> struct C;
183183
template <typename T> struct C<T, T::value>;
184184
// expected-error@-1 {{type of specialized non-type template argument depends on a template parameter of the partial specialization}}
185-
}
185+
} // namespace cwg1315
186186

187187
namespace cwg1330 { // cwg1330: 4 c++11
188188
// exception-specifications are parsed in a context where the class is complete.
@@ -302,7 +302,7 @@ namespace cwg1330 { // cwg1330: 4 c++11
302302

303303
struct E : C<int> {}; // #cwg1330-C-int
304304
E e; // #cwg1330-e
305-
}
305+
} // namespace cwg1330
306306

307307
// cwg1334: sup 1719
308308

@@ -333,7 +333,7 @@ struct S {
333333
int z : 1 || new int { 0 };
334334
};
335335
#endif
336-
}
336+
} // namespace cwg1341
337337

338338
namespace cwg1346 { // cwg1346: 3.5
339339
auto a(1);
@@ -376,7 +376,7 @@ namespace cwg1346 { // cwg1346: 3.5
376376
// since-cxx11-error@-2 {{cannot deduce type for lambda capture 'e' from parenthesized initializer list}}
377377
}
378378
#endif
379-
}
379+
} // namespace cwg1346
380380

381381
namespace cwg1347 { // cwg1347: 3.1
382382
auto x = 5, *y = &x;
@@ -390,7 +390,7 @@ namespace cwg1347 { // cwg1347: 3.1
390390
auto (*fp)(int) -> int, i = 0;
391391
// since-cxx11-error@-1 {{declaration with trailing return type must be the only declaration in its group}}
392392
#endif
393-
}
393+
} // namespace cwg1347
394394

395395
namespace cwg1350 { // cwg1350: 3.5
396396
#if __cplusplus >= 201103L
@@ -520,7 +520,7 @@ namespace cwg1358 { // cwg1358: 3.1
520520
// cxx11-20-note@#cwg1358-NonLit {{'NonLit' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors}}
521521
};
522522
#endif
523-
}
523+
} // namespace cwg1358
524524

525525
namespace cwg1359 { // cwg1359: 3.5
526526
#if __cplusplus >= 201103L
@@ -549,7 +549,7 @@ namespace cwg1359 { // cwg1359: 3.5
549549
// cxx11-17-note@#cwg1359-Y {{candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided}}
550550
// cxx11-17-note@#cwg1359-Y {{candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 0 were provided}}
551551
#endif
552-
}
552+
} // namespace cwg1359
553553

554554
namespace cwg1388 { // cwg1388: 4
555555
template<typename A, typename ...T> void f(T..., A); // #cwg1388-f
@@ -622,7 +622,7 @@ namespace cwg1388 { // cwg1388: 4
622622
// expected-error@-1 {{no matching function for call to 'f_pair_4'}}
623623
// expected-note@#cwg1388-f-4 {{candidate template ignored: deduced packs of different lengths for parameter 'T' (<int, long> vs. <int, long, const char *>)}}
624624
}
625-
}
625+
} // namespace cwg1388
626626

627627
namespace cwg1391 { // cwg1391: partial
628628
struct A {}; struct B : A {};
@@ -713,14 +713,14 @@ namespace cwg1391 { // cwg1391: partial
713713
int test_c1 = c(0); // ok
714714
int test_c2 = c<int>(0); // FIXME: apparently ambiguous
715715
}
716-
}
716+
} // namespace cwg1391
717717

718718
namespace cwg1394 { // cwg1394: 15
719719
#if __cplusplus >= 201103L
720720
struct Incomplete;
721721
Incomplete f(Incomplete) = delete; // well-formed
722722
#endif
723-
}
723+
} // namespace cwg1394
724724

725725
namespace cwg1395 { // cwg1395: 16
726726
#if __cplusplus >= 201103L
@@ -731,7 +731,7 @@ namespace cwg1395 { // cwg1395: 16
731731
f(&i);
732732
}
733733
#endif
734-
}
734+
} // namespace cwg1395
735735

736736
namespace cwg1397 { // cwg1397: 3.2
737737
#if __cplusplus >= 201103L
@@ -757,4 +757,4 @@ namespace cwg1399 { // cwg1399: dup 1388
757757
// expected-error@-1 {{no matching function for call to 'f'}}
758758
// expected-note@#cwg1399-f {{candidate template ignored: deduced packs of different lengths for parameter 'T' (<> vs. <int, int>)}}
759759
}
760-
}
760+
} // namespace cwg1399

0 commit comments

Comments
 (0)