[clang] [Clang] Warn on duplicate standard attributes (PR #176252)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 15 17:08:57 PST 2026


================
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++17 -verify %s
+
+int foo([[maybe_unused, maybe_unused]] int a) { // expected-warning {{attribute 'maybe_unused' is already applied}}
----------------
shafik wrote:

You should also test cases like this: https://godbolt.org/z/G99qM5eGE

There are probably other attributes you should be testing as well.

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


More information about the cfe-commits mailing list