[clang] [Clang] Warn on deprecated specializations used in system headers. (PR #70353)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 17 07:38:25 PST 2023


================
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+#ifdef BE_THE_HEADER
+#pragma clang system_header
+
+template <typename T>
+struct traits;
+
+template <>
+struct [[ deprecated]] traits<int> {}; // expected-note {{'traits<int>' has been explicitly marked deprecated here}}
----------------
AaronBallman wrote:

```suggestion
struct [[deprecated]] traits<int> {}; // expected-note {{'traits<int>' has been explicitly marked deprecated here}}
```

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


More information about the cfe-commits mailing list