https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93414
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:de0684bf3f72c1e7a29704bce215ab40bcb84bb6 commit r10-6224-gde0684bf3f72c1e7a29704bce215ab40bcb84bb6 Author: Marek Polacek <pola...@redhat.com> Date: Fri Jan 24 18:08:58 2020 -0500 c++: Poor diagnostic for dynamic_cast in constexpr context [PR93414] I neglected to add a proper diagnostic for the reference dynamic_cast case when the operand of a dynamic_cast doesn't refer to a public base of Derived, resulting in suboptimal error message error: call to non-'constexpr' function 'void* __cxa_bad_cast()' 2020-01-25 Marek Polacek <pola...@redhat.com> PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context. * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference dynamic_cast diagnostic. * g++.dg/cpp2a/constexpr-dynamic18.C: New test.