[Bug c++/125492] [reflection] Misleading error message when `std::meta::size_of` is applied to a reflected function type
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jun 17 15:41:35 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125492
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:8b3e2e68208730dc95a7803a21a545e93c735d5b
commit r17-1627-g8b3e2e68208730dc95a7803a21a545e93c735d5b
Author: Marek Polacek <polacek@redhat.com>
Date: Thu Jun 11 12:18:36 2026 -0400
c++/reflection: tweak size_of diagnostic [PR125492]
Here we say "reflection with incomplete type" when size_of
got a reflection of a function. Let's clarify that diagnostic.
PR c++/125492
gcc/cp/ChangeLog:
* reflect.cc (eval_size_of): Add a separate throw_exception for
function types.
gcc/testsuite/ChangeLog:
* g++.dg/reflect/size_of2.C: New test.
Reviewed-by: Patrick Palka <ppalka@redhat.com>
More information about the Gcc-bugs
mailing list