diff options
author | Patrick Palka <ppalka@redhat.com> | 2023-05-07 10:24:52 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2023-05-07 10:24:52 -0400 |
commit | 681ba2f7681f295a102cd63ffd5ce2b86a5f706e (patch) | |
tree | 46a5a0404532f5537a509e78b186d16cdac69dd8 /gcc/tree-ssa-phiopt.cc | |
parent | 7f4840ddef9746ab591c78ecdd750e3b18aa1ce6 (diff) | |
download | gcc-681ba2f7681f295a102cd63ffd5ce2b86a5f706e.zip gcc-681ba2f7681f295a102cd63ffd5ce2b86a5f706e.tar.gz gcc-681ba2f7681f295a102cd63ffd5ce2b86a5f706e.tar.bz2 |
c++: non-dep init folding and access checking [PR109480]
enforce_access currently checks processing_template_decl to decide
whether to defer the given access check until instantiation time.
But using this flag is unreliable because it gets cleared during e.g.
non-dependent initializer folding, and so can lead to premature access
check failures as in the below testcase. It seems better to check
current_template_parms instead.
PR c++/109480
gcc/cp/ChangeLog:
* semantics.cc (enforce_access): Check current_template_parms
instead of processing_template_decl when deciding whether to
defer the access check.
gcc/testsuite/ChangeLog:
* g++.dg/template/non-dependent25a.C: New test.
Diffstat (limited to 'gcc/tree-ssa-phiopt.cc')
0 files changed, 0 insertions, 0 deletions