[clang] [Clang][NFC] Rearrange tests for CWG 2707 after #110473 (PR #110842)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 2 06:49:53 PDT 2024
================
@@ -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 at -1 {{no viable constructor or deduction guide}} \
+// since-cxx20-note@#cwg2707-A {{candidate function template not viable}} \
----------------
Endilll wrote:
```suggestion
// since-cxx20-note@#cwg2707-A {{candidate function template not viable}} \
```
Indent this and all of the following notes.
https://github.com/llvm/llvm-project/pull/110842
More information about the cfe-commits
mailing list