bool *, bool *, tree *);
extern tree get_reflection (location_t, tree, reflect_kind = REFLECT_UNDEF);
extern tree get_null_reflection () ATTRIBUTE_PURE;
+extern bool null_reflection_p (const_tree) ATTRIBUTE_PURE;
extern tree splice (tree);
extern bool check_out_of_consteval_use (tree, bool = true);
extern bool consteval_only_p (tree) ATTRIBUTE_PURE;
pp_right_paren (pp);
break;
default:
+ if (null_reflection_p (t))
+ {
+ pp_cxx_ws_string (pp, "std::meta::info{}");
+ break;
+ }
pp_string (pp, "^^");
pp->set_padding (pp_none);
if (DECL_P (h))
return null_reflection;
}
+/* True iff T is a null reflection. */
+
+bool
+null_reflection_p (const_tree t)
+{
+ return (t && TREE_CODE (t) == REFLECT_EXPR
+ && REFLECT_EXPR_HANDLE (t) == unknown_type_node);
+}
+
/* Do strip_typedefs on T, but only for types. */
static tree
return error_mark_node;
}
- if (compare_reflections (refl, get_null_reflection ()))
+ if (null_reflection_p (refl))
{
error_at (loc, "cannot splice a null reflection");
return error_mark_node;
static_assert (parameters_of (^^qux)[0] == parameters_of (^^qux)[1]); // { dg-error "static assertion failed" }
// { dg-message "note: the comparison reduces to '\\\(parameters_of\\\(\\\^\\\^qux\\\(int, int\\\)\\\)\\\[0\\\] \\\{aka x\\\} == parameters_of\\\(\\\^\\\^qux\\\(int, int\\\)\\\)\\\[1\\\] \\\{aka y\\\}\\\)'" "" { target *-*-* } .-1 }
+
+static_assert (std::meta::info{} == ^^int); // { dg-error "static assertion failed" }
+// { dg-message {note: the comparison reduces to '\(std::meta::info{} == \^\^int\)} "" { target *-*-* } .-1 }