-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[Clang][NFC] Rearrange tests for CWG 2707 after #110473 #110842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-clang Author: Younan Zhang (zyn0217) ChangesThis addresses comments from @Endilll in the post commit review of #110473. Full diff: https://github.com/llvm/llvm-project/pull/110842.diff 1 Files Affected:
diff --git a/clang/test/CXX/drs/cwg27xx.cpp b/clang/test/CXX/drs/cwg27xx.cpp
index 581e2af822d556..cb08c17b4b3bef 100644
--- a/clang/test/CXX/drs/cwg27xx.cpp
+++ b/clang/test/CXX/drs/cwg27xx.cpp
@@ -2,9 +2,9 @@
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -pedantic-errors -verify=expected %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++14 -pedantic-errors -verify=expected %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++17 -pedantic-errors -verify=expected %s
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++20 -pedantic-errors -verify=expected %s
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++23 -pedantic-errors -verify=expected,since-cxx23 %s
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++2c -pedantic-errors -verify=expected,since-cxx23,since-cxx26 %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++20 -pedantic-errors -verify=expected,since-cxx20 %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++23 -pedantic-errors -verify=expected,since-cxx20,since-cxx23 %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++2c -pedantic-errors -verify=expected,since-cxx20,since-cxx23,since-cxx26 %s
#if __cplusplus == 199711L
#define static_assert(...) __extension__ _Static_assert(__VA_ARGS__)
@@ -29,6 +29,35 @@ namespace std {
#endif
} // namespace std
+namespace cwg2707 { // cwg2707: 20
+
+#if __cplusplus >= 202002L
+
+template <class T, unsigned N> struct A { // #cwg2707-A
+ T value[N];
+};
+
+template <typename... T>
+A(T...) -> A<int, sizeof...(T)> requires (sizeof...(T) == 2); // #cwg2707-guide-A
+
+// Brace elision is not allowed for synthesized CTAD guides if the array size
+// is value-dependent.
+// So this should pick up our explicit deduction guide.
+A a = {1, 2};
+
+A b = {3, 4, 5};
+// since-cxx20-error@-1 {{no viable constructor or deduction guide}} \
+// since-cxx20-note@#cwg2707-A {{candidate function template not viable}} \
+// since-cxx20-note@#cwg2707-A {{implicit deduction guide}} \
+// since-cxx20-note@#cwg2707-guide-A {{constraints not satisfied}} \
+// since-cxx20-note@#cwg2707-guide-A {{because 'sizeof...(T) == 2' (3 == 2) evaluated to false}} \
+// since-cxx20-note@#cwg2707-A {{candidate function template not viable}} \
+// since-cxx20-note@#cwg2707-A {{implicit deduction guide}}
+
+#endif
+
+} // namespace cwg2707
+
namespace cwg2718 { // cwg2718: 2.7
struct B {};
struct D;
@@ -200,32 +229,3 @@ static_assert(false, f().s);
// since-cxx26-error@-1 {{static assertion failed: Hello}}
#endif
} // namespace cwg2798
-
-namespace cwg2707 { // cwg2707: 20
-
-#if __cplusplus >= 202002L
-
-template <class T, unsigned N> struct A {
- T value[N];
-};
-
-template <typename... T>
-A(T...) -> A<int, sizeof...(T)> requires (sizeof...(T) == 2);
-
-// Brace elision is not allowed for synthesized CTAD guides if the array size
-// is value-dependent.
-// So this should pick up our explicit deduction guide.
-A a = {1, 2};
-
-A b = {3, 4, 5};
-// expected-error@-1 {{no viable constructor or deduction guide}} \
-// expected-note@-13 {{candidate function template not viable}} \
-// expected-note@-13 {{implicit deduction guide}} \
-// expected-note@-8 {{constraints not satisfied}} \
-// expected-note@-8 {{because 'sizeof...(T) == 2' (3 == 2) evaluated to false}} \
-// expected-note@-13 {{candidate function template not viable}} \
-// expected-note@-13 {{implicit deduction guide}}
-
-#endif
-
-} // namespace cwg2707
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/123/builds/6839 Here is the relevant piece of the build log for the reference
|
) This addresses comments from @Endilll in the post commit review of llvm#110473.
This addresses comments from @Endilll in the post commit review of #110473.