https://gcc.gnu.org/g:f805f14636ef95f7763093b695e1598310afa23f

commit r16-8363-gf805f14636ef95f7763093b695e1598310afa23f
Author: Jakub Jelinek <[email protected]>
Date:   Tue Mar 31 18:31:00 2026 +0200

    testsuite: Add testcase for CWG3145 - Uniqueness of annotations
    
    We already implement this, so just adding a testcase for it.
    
    2026-03-31  Jakub Jelinek  <[email protected]>
    
            * g++.dg/reflect/annotations16.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/reflect/annotations16.C | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gcc/testsuite/g++.dg/reflect/annotations16.C 
b/gcc/testsuite/g++.dg/reflect/annotations16.C
new file mode 100644
index 000000000000..67effb0bf12b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/reflect/annotations16.C
@@ -0,0 +1,10 @@
+// CWG3145 - Uniqueness of annotations
+// { dg-do compile { target c++26 } }
+// { dg-additional-options "-freflection" }
+
+#include <meta>
+
+template <int>
+int x [[=1]];
+static_assert (annotations_of (^^x<0>) != annotations_of (^^x<1>));
+static_assert (annotations_of (^^x<42>) == annotations_of (^^x<42>));

Reply via email to