]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++/reflection: add fixed test [PR123616]
authorMarek Polacek <polacek@redhat.com>
Sat, 7 Feb 2026 22:28:28 +0000 (17:28 -0500)
committerMarek Polacek <polacek@redhat.com>
Sat, 7 Feb 2026 22:28:49 +0000 (17:28 -0500)
This was fixed by r16-7330-g507ea25cf2e18b.

PR c++/123616

gcc/testsuite/ChangeLog:

* g++.dg/reflect/type_of3.C: New test.

gcc/testsuite/g++.dg/reflect/type_of3.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/reflect/type_of3.C b/gcc/testsuite/g++.dg/reflect/type_of3.C
new file mode 100644 (file)
index 0000000..ba28c4f
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/123616
+// { dg-do compile { target c++26 } }
+// { dg-additional-options "-freflection" }
+
+#include <meta>
+using namespace std::meta;
+
+struct S {
+    auto g() { return 0; }
+};
+int h() { return 0; }
+
+static_assert(type_of(^^S::g) == type_of(^^h));