https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105386
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:8969d00bf16a8f4de79306010fca8f14f91c171d commit r11-9947-g8969d00bf16a8f4de79306010fca8f14f91c171d Author: Patrick Palka <ppa...@redhat.com> Date: Tue Apr 26 10:53:38 2022 -0400 c++: decltype of non-dependent call of class type [PR105386] We need to pass tf_decltype when instantiating a non-dependent decltype operand, like tsubst does in the dependent case, so that we don't force completion of a prvalue operand's class type. PR c++/105386 gcc/cp/ChangeLog: * semantics.c (finish_decltype_type): Pass tf_decltype to instantiate_non_dependent_expr_sfinae. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/decltype81.C: New test. (cherry picked from commit b6a48401da51e9042b6f0822d532b3b472492658)