[clang] [Clang] Implement CWG2900 (PR #224291)

Yanzuo Liu via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 09:01:20 PDT 2026


================
@@ -8,6 +8,38 @@
 
 // cxx98-no-diagnostics
 
+namespace cwg2900 { // cwg2900: 24
+#if __cplusplus >= 201703L
+// [temp.deduct.type] Example 13.
+template <int &> struct E;
+template <auto x> void f(E<x> *); // #cwg2900-f-E
+int v;
+void g(E<v> *bp) {
+  f(bp);
+  // since-cxx11-error at -1 {{no matching function for call to 'f'}}
+  //   since-cxx11-note@#cwg2900-f-E {{candidate template ignored: substitution failure: non-type template argument is not a constant expression}}
----------------
zwuis wrote:

```diff
-since-cxx11
+since-cxx17
```

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


More information about the cfe-commits mailing list