https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87768
--- Comment #3 from Alexandre Oliva <aoliva at gcc dot gnu.org> --- Author: aoliva Date: Thu Jan 17 07:32:29 2019 New Revision: 268006 URL: https://gcc.gnu.org/viewcvs?rev=268006&root=gcc&view=rev Log: [PR87768] reset location wrapper suppression when reentering top level Concepts-checking and other kinds of early tsubsting may often take place while location wrappers are suppressed, e.g. because we've triggered template instantiation within template parameter lists. With that, exprs that are usually wrapped by VIEW_CONVERT_EXPRs location wrappers may end up wrapped by NON_LVALUE_EXPRs that are not marked as location wrappers. If such NON_LVALUE_EXPRs tsubsted exprs undergo another round of tsubsting, say for constraint checking, or even for another round of specialization, they will be rejected by tsubst_copy_and_build. This patch arranges for suppress_location_wrappers to be saved and reset when pushing to the top level, and restored when popping from it. for gcc/cp/ChangeLog PR c++/87768 * cp-tree.h (saved_scope): Add suppress_location_wrappers. * name-lookup.c (do_push_to_top_level): Save and reset it. (do_pop_from_top_level): Restore it. for gcc/testsuite/ChangeLog PR c++/87768 * g++.dg/concepts/pr87768.C: New. Added: trunk/gcc/testsuite/g++.dg/concepts/pr87768.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/name-lookup.c trunk/gcc/testsuite/ChangeLog