On 1/16/19 11:26 PM, Alexandre Oliva wrote:
On Jan  2, 2019, Jason Merrill <ja...@redhat.com> wrote:

On 12/30/18 11:31 PM, Alexandre Oliva wrote:
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 introduces a sentinel to reset suppress_location_wrappers
to zero, and uses it for template class and decl instantiation,
including constraint checking.

Instead of a new class, let's add this to saved_scope and
push_to/pop_from_top_level.

Like this?  Regstrapped on x86_64- and i686-linux-gnu.


[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.

OK.

Jason

Reply via email to