[clang] [Clang][Sema] Implement proposed resolution for CWG2847 (PR #80899)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 12:07:21 PST 2024


================
@@ -0,0 +1,41 @@
+// RUN: %clang_cc1 -std=c++20 -verify=expected %s
+
+namespace dr2847 { // dr2847: 19
+
+template<typename>
+void i();
+
+struct A {
+  template<typename>
+  void f() requires true;
+
+  template<>
+  void f<int>() requires true; // expected-error {{explicit specialization cannot have a trailing requires clause unless it declares a function template}}
----------------
Endilll wrote:

As this error only shows up in C++20 mode and higher, directive should read `since-cxx20-error`. You should also convert it to `since-cxx20-error at -1` style, which the rest of DR test suite follows.

https://github.com/llvm/llvm-project/pull/80899


More information about the cfe-commits mailing list