I think a USING_STMT operand shouldn't count as consteval-only use.
2026-05-07 Jakub Jelinek <jakub@redhat.com>
PR c++/125184
* reflect.cc (check_out_of_consteval_use_r): Don't walk children of
USING_STMTs.
* g++.dg/reflect/using3.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
|| TREE_CODE (t) == INIT_EXPR
/* And don't recurse on DECL_EXPRs. */
|| TREE_CODE (t) == DECL_EXPR
+ /* Neither into USING_STMT. */
+ || TREE_CODE (t) == USING_STMT
/* Blocks can appear in the TREE_VEC operand of OpenMP
depend/affinity/map/to/from OMP_CLAUSEs when using iterators. */
|| TREE_CODE (t) == BLOCK)
--- /dev/null
+// PR c++/125184
+// { dg-do compile { target c++26 } }
+// { dg-additional-options "-freflection" }
+
+#include <meta>
+
+void
+foo ()
+{
+ using std::meta::info;
+}