On Thu, Dec 04, 2025 at 02:09:21PM +0100, Jakub Jelinek wrote:
> FAIL: g++.dg/reflect/enumerators_of1.C  -std=c++26 (test for excess errors)
> FAIL: g++.dg/reflect/p2996-17.C  -std=c++26 (test for excess errors)

Added now following which also fail with the metafns_called = true;
line commented out:

--- gcc/testsuite/g++.dg/reflect/has_identifier2.C.jj
+++ gcc/testsuite/g++.dg/reflect/has_identifier2.C
@@ -0,0 +1,57 @@
+// { dg-do compile { target c++26 } }
+// { dg-additional-options "-freflection" }
+// Test std::meta::has_identifier.
+
+#include <meta>
+
+using namespace std::meta;
+
+namespace N
+{
+  consteval bool
+  has_identifier (info r) { return std::meta::has_identifier (r); }
+  consteval std::vector<info>
+  parameters_of (info r) { return std::meta::parameters_of (r); }
+  consteval info
+  variable_of (info r) { return std::meta::variable_of (r); }
+}
+
+void qux (int, int b, int c, int d, int);
+constexpr auto p0 = N::parameters_of (^^qux)[0];
+constexpr auto p1 = N::parameters_of (^^qux)[1];
+constexpr auto p2 = N::parameters_of (^^qux)[2];
+constexpr auto p3 = N::parameters_of (^^qux)[3];
+constexpr auto p4 = N::parameters_of (^^qux)[4];
+static_assert (!N::has_identifier (p0));
+static_assert (N::has_identifier (p1));
+static_assert (N::has_identifier (p2));
+static_assert (N::has_identifier (p3));
+static_assert (!N::has_identifier (p4));
+void qux (int a, int, int c, int e, int);
+static_assert (N::has_identifier (p0));
+static_assert (N::has_identifier (p1));
+static_assert (N::has_identifier (p2));
+static_assert (!N::has_identifier (p3));
+static_assert (!N::has_identifier (p4));
+
+void
+qux (int a, int, int, int e, int)
+{
+  static_assert (N::has_identifier (p0));
+  static_assert (N::has_identifier (p1));
+  static_assert (N::has_identifier (p2));
+  static_assert (!N::has_identifier (p3));
+  static_assert (!N::has_identifier (p4));
+  static_assert (N::has_identifier (N::variable_of (p0)));
+  static_assert (!N::has_identifier (N::variable_of (p1)));
+  static_assert (!N::has_identifier (N::variable_of (p2)));
+  static_assert (N::has_identifier (N::variable_of (p3)));
+  static_assert (!N::has_identifier (N::variable_of (p4)));
+}
+
+void qux (int f, int, int, int, int g);
+static_assert (!N::has_identifier (p0));
+static_assert (N::has_identifier (p1));
+static_assert (N::has_identifier (p2));
+static_assert (!N::has_identifier (p3));
+static_assert (N::has_identifier (p4));
--- gcc/testsuite/g++.dg/reflect/is_complete_type2.C.jj
+++ gcc/testsuite/g++.dg/reflect/is_complete_type2.C
@@ -0,0 +1,25 @@
+// { dg-do compile { target c++26 } }
+// { dg-additional-options "-freflection" }
+// Test std::meta::is_complete_type.
+
+#include <meta>
+
+using namespace std::meta;
+
+struct S;
+
+namespace N
+{
+  consteval bool
+  is_complete_type (info r) { return std::meta::is_complete_type (r); }
+}
+
+static_assert (!is_complete_type (^^S));
+static_assert (!N::is_complete_type (^^S));
+
+consteval {
+  define_aggregate (^^S, {});
+}
+
+static_assert (is_complete_type (^^S));
+static_assert (N::is_complete_type (^^S));

        Jakub

Reply via email to