Skip to content

Commit

Permalink
merge main into amd-staging
Browse files Browse the repository at this point in the history
Change-Id: I8a3e8948763b7a20aa928f817aaabc93823681ea
  • Loading branch information
Jenkins committed Jan 5, 2025
2 parents 799be2e + 0fc8fc7 commit 55f1846
Show file tree
Hide file tree
Showing 86 changed files with 2,012 additions and 1,740 deletions.
157 changes: 79 additions & 78 deletions clang/test/CXX/drs/cwg0xx.cpp

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions clang/test/CXX/drs/cwg10xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// RUN: %clang_cc1 -std=c++17 %s -verify=expected,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++20 %s -verify=expected,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++23 %s -verify=expected,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++2c %s -verify=expected,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors

namespace std {
__extension__ typedef __SIZE_TYPE__ size_t;
Expand All @@ -12,7 +13,7 @@ namespace std {
const T *p; size_t n;
initializer_list(const T *p, size_t n);
};
}
} // namespace std

namespace cwg1004 { // cwg1004: 5
template<typename> struct A {};
Expand Down Expand Up @@ -43,7 +44,7 @@ namespace cwg1004 { // cwg1004: 5
// expected-error@-1 {{is a constructor name}}
// expected-note@#cwg1004-t {{in instantiation of default argument}}
Third<A<int> > t; // #cwg1004-t
}
} // namespace cwg1004

namespace cwg1042 { // cwg1042: 3.5
#if __cplusplus >= 201402L
Expand All @@ -58,7 +59,7 @@ namespace cwg1042 { // cwg1042: 3.5
// list in this mode.
using foo [[]] = int;
#endif
}
} // namespace cwg1042

namespace cwg1048 { // cwg1048: 3.6
struct A {};
Expand All @@ -76,7 +77,7 @@ namespace cwg1048 { // cwg1048: 3.6
}
} (0);
#endif
}
} // namespace cwg1048

namespace cwg1054 { // cwg1054: no
// FIXME: Test is incomplete.
Expand All @@ -89,7 +90,7 @@ namespace cwg1054 { // cwg1054: no
a;
// expected-warning@-1 {{expression result unused; assign into a variable to force a volatile load}}
}
}
} // namespace cwg1054

namespace cwg1070 { // cwg1070: 3.5
#if __cplusplus >= 201103L
Expand All @@ -108,4 +109,4 @@ namespace cwg1070 { // cwg1070: 3.5
};
C c = {};
#endif
}
} // namespace cwg1070
6 changes: 5 additions & 1 deletion clang/test/CXX/drs/cwg118.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// RUN: %clang_cc1 -triple x86_64-linux -std=c++98 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
// RUN: %clang_cc1 -triple x86_64-linux -std=c++11 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
// RUN: %clang_cc1 -triple x86_64-linux -std=c++14 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
// RUN: %clang_cc1 -triple x86_64-linux -std=c++1z %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
// RUN: %clang_cc1 -triple x86_64-linux -std=c++17 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
// RUN: %clang_cc1 -triple x86_64-linux -std=c++20 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
// RUN: %clang_cc1 -triple x86_64-linux -std=c++23 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
// RUN: %clang_cc1 -triple x86_64-linux -std=c++2c %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "


// cwg118: yes

Expand Down
50 changes: 47 additions & 3 deletions clang/test/CXX/drs/cwg11xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// RUN: %clang_cc1 -std=c++11 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++14 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++17 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++2a %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++20 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++23 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++2c %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors

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

namespace cwg1111 { // cwg1111: 3.2
namespace cwg1111 { // cwg1111: partial
namespace example1 {
template <typename> struct set; // #cwg1111-struct-set

Expand Down Expand Up @@ -57,6 +59,48 @@ void baz() {
a.operator A();
}
} // namespace example2

namespace example3 {
struct A {
operator int();
} a;
void foo() {
typedef int T;
a.operator T(); // T is found using unqualified lookup
// after qualified lookup in A fails.
}
} // namespace example3

namespace example4 {
struct A {
typedef int T; // #cwg1111-A-T
operator T();
};
struct B : A {
operator T();
} b;
void foo() {
b.A::operator T(); // FIXME: qualified lookup should find T in A.
// expected-error@-1 {{unknown type name 'T'}}
// expected-note@#cwg1111-A-T {{'A::T' declared here}}
}
} // namespace example4

namespace example5 {
template <class T1> struct A {
operator T1();
};
template <class T2> struct B : A<T2> {
operator T2();
void foo() {
// In both cases, during instantiation, qualified lookup for T2 wouldn't be able
// to find anything, so T2 has to be found by unqualified lookup.
// After that, 'operator T2()' is found in A<T2> by qualfied lookup.
T2 a = A<T2>::operator T2();
T2 b = ((A<T2> *)this)->operator T2();
}
};
} // namespace example5
} // namespace cwg1111

namespace cwg1113 { // cwg1113: partial
Expand Down Expand Up @@ -84,6 +128,6 @@ namespace cwg1113 { // cwg1113: partial
extern "C" void f();
}
void g() { f(); }
}
} // namespace cwg1113

// cwg1150: na
19 changes: 9 additions & 10 deletions clang/test/CXX/drs/cwg12xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// RUN: %clang_cc1 -std=c++17 %s -verify=expected,since-cxx17,since-cxx14,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++20 %s -verify=expected,since-cxx17,since-cxx14,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++23 %s -verify=expected,since-cxx17,since-cxx14,since-cxx11,since-cxx23 -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++2c %s -verify=expected,since-cxx17,since-cxx14,since-cxx11,since-cxx23 -fexceptions -fcxx-exceptions -pedantic-errors

// cwg1200: na

Expand All @@ -29,10 +30,10 @@ namespace cwg1213 { // cwg1213: 7
using U = decltype(V4Int()[0]);
using U = decltype(EV4Int()[0]);
#endif
}
} // namespace cwg1213

#if __cplusplus >= 201103L
namespace cwg1223 { // cwg1223: 17
#if __cplusplus >= 201103L
struct M;
template <typename T>
struct V;
Expand Down Expand Up @@ -82,12 +83,11 @@ void g() {
sizeof(auto () -> C[1]);
// since-cxx11-error@-1 {{function cannot return array type 'C[1]' (aka 'cwg1223::BB[1]')}}
}

}
#endif
} // namespace cwg1223

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

namespace cwg1250 { // cwg1250: 3.9
struct Incomplete;
Expand All @@ -114,7 +114,7 @@ struct Base {
struct Derived : Base {
virtual Incomplete *meow();
};
}
} // namespace cwg1250

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

// cwg1291: na

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

} // namespace cwg1295
32 changes: 16 additions & 16 deletions clang/test/CXX/drs/cwg13xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ namespace std {
size_t n;
initializer_list(const T*, size_t);
};
}
} // namespace std

#if __cplusplus >= 201103L
namespace cwg1305 { // cwg1305: 3.0
#if __cplusplus >= 201103L
struct Incomplete; // #cwg1305-Incomplete
struct Complete {};

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

namespace cwg1307 { // cwg1307: 14
#if __cplusplus >= 201103L
Expand Down Expand Up @@ -150,7 +150,7 @@ namespace cwg1310 { // cwg1310: 5
}
template void wt_test<W<int> >(); // #cwg1310-W-int
template void wt_test_good<W<int> >();
}
} // namespace cwg1310

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

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

struct E : C<int> {}; // #cwg1330-C-int
E e; // #cwg1330-e
}
} // namespace cwg1330

// cwg1334: sup 1719

Expand Down Expand Up @@ -333,7 +333,7 @@ struct S {
int z : 1 || new int { 0 };
};
#endif
}
} // namespace cwg1341

namespace cwg1346 { // cwg1346: 3.5
auto a(1);
Expand Down Expand Up @@ -376,7 +376,7 @@ namespace cwg1346 { // cwg1346: 3.5
// since-cxx11-error@-2 {{cannot deduce type for lambda capture 'e' from parenthesized initializer list}}
}
#endif
}
} // namespace cwg1346

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

namespace cwg1350 { // cwg1350: 3.5
#if __cplusplus >= 201103L
Expand Down Expand Up @@ -520,7 +520,7 @@ namespace cwg1358 { // cwg1358: 3.1
// 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}}
};
#endif
}
} // namespace cwg1358

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

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

namespace cwg1391 { // cwg1391: partial
struct A {}; struct B : A {};
Expand Down Expand Up @@ -713,14 +713,14 @@ namespace cwg1391 { // cwg1391: partial
int test_c1 = c(0); // ok
int test_c2 = c<int>(0); // FIXME: apparently ambiguous
}
}
} // namespace cwg1391

namespace cwg1394 { // cwg1394: 15
#if __cplusplus >= 201103L
struct Incomplete;
Incomplete f(Incomplete) = delete; // well-formed
#endif
}
} // namespace cwg1394

namespace cwg1395 { // cwg1395: 16
#if __cplusplus >= 201103L
Expand All @@ -731,7 +731,7 @@ namespace cwg1395 { // cwg1395: 16
f(&i);
}
#endif
}
} // namespace cwg1395

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

0 comments on commit 55f1846

Please sign in to comment.