[clang] 4e2a629 - [Clang] add DR tests for D128745
Yuanfang Chen via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 17 23:26:34 PDT 2022
Author: Yuanfang Chen
Date: 2022-10-17T23:24:29-07:00
New Revision: 4e2a629c7238008de0ab45e6bb96aeaecac2bca9
URL: https://github.com/llvm/llvm-project/commit/4e2a629c7238008de0ab45e6bb96aeaecac2bca9
DIFF: https://github.com/llvm/llvm-project/commit/4e2a629c7238008de0ab45e6bb96aeaecac2bca9.diff
LOG: [Clang] add DR tests for D128745
Added:
Modified:
clang/test/CXX/drs/dr13xx.cpp
clang/test/CXX/drs/dr14xx.cpp
clang/test/CXX/drs/dr6xx.cpp
Removed:
################################################################################
diff --git a/clang/test/CXX/drs/dr13xx.cpp b/clang/test/CXX/drs/dr13xx.cpp
index dc116f75b1aed..1a792f838e87c 100644
--- a/clang/test/CXX/drs/dr13xx.cpp
+++ b/clang/test/CXX/drs/dr13xx.cpp
@@ -457,6 +457,17 @@ Incomplete f(Incomplete) = delete; // well-formed
#endif
}
+namespace dr1395 { // dr1395: 16
+#if __cplusplus >= 201103L
+ template <typename T, typename... U> void f(T, U...);
+ template <typename T> void f(T);
+ void h(int i) {
+ // This is made ambiguous by dr692, but made valid again by dr1395.
+ f(&i);
+ }
+#endif
+}
+
namespace dr1399 { // dr1399: dup 1388
template<typename ...T> void f(T..., int, T...) {} // expected-note {{candidate}} expected-error 0-1{{C++11}}
void g() {
diff --git a/clang/test/CXX/drs/dr14xx.cpp b/clang/test/CXX/drs/dr14xx.cpp
index 526211c0e0062..7d27d3b542443 100644
--- a/clang/test/CXX/drs/dr14xx.cpp
+++ b/clang/test/CXX/drs/dr14xx.cpp
@@ -36,6 +36,27 @@ namespace dr1423 { // dr1423: 11
#endif
}
+namespace dr1432 { // dr1432: 16
+#if __cplusplus >= 201103L
+ template<typename T> T declval();
+
+ template <class... T>
+ struct common_type;
+
+ template <class T, class U>
+ struct common_type<T, U> {
+ typedef decltype(true ? declval<T>() : declval<U>()) type;
+ };
+
+ template <class T, class U, class... V>
+ struct common_type<T, U, V...> {
+ typedef typename common_type<typename common_type<T, U>::type, V...>::type type;
+ };
+
+ template struct common_type<int, double>;
+#endif
+}
+
namespace dr1443 { // dr1443: yes
struct A {
int i;
diff --git a/clang/test/CXX/drs/dr6xx.cpp b/clang/test/CXX/drs/dr6xx.cpp
index 527379590bd39..494d857e829ae 100644
--- a/clang/test/CXX/drs/dr6xx.cpp
+++ b/clang/test/CXX/drs/dr6xx.cpp
@@ -1079,16 +1079,16 @@ namespace dr687 { // dr687 (9 c++20, but the issue is still considered open)
}
}
-namespace dr692 { // dr692: no
+namespace dr692 { // dr692: 16
// Also see dr1395.
namespace temp_func_order_example2 {
template <typename... T> struct A1 {}; // expected-error 0-1{{C++11}}
template <typename U, typename... T> struct A2 {}; // expected-error 0-1{{C++11}}
- template <class T1, class... U> void e1(A1<T1, U...>) = delete; // expected-error 0-2{{C++11}}
- template <class T1> void e1(A1<T1>);
- template <class T1, class... U> void e2(A2<T1, U...>) = delete; // expected-error 0-2{{C++11}}
- template <class T1> void e2(A2<T1>);
+ template <typename T1, typename... U> void e1(A1<T1, U...>) = delete; // expected-error 0-2{{C++11}}
+ template <typename T1> void e1(A1<T1>);
+ template <typename T1, typename... U> void e2(A2<T1, U...>) = delete; // expected-error 0-2{{C++11}}
+ template <typename T1> void e2(A2<T1>);
template <typename T, typename U> void f(U, A1<U, T> *p = 0) = delete; // expected-note {{candidate}} expected-error 0-1{{C++11}}
template <typename U> int &f(U, A1<U, U> *p = 0); // expected-note {{candidate}}
template <typename T> void g(T, T = T()); // expected-note {{candidate}}
More information about the cfe-commits
mailing list