diff options
author | Nathan Sidwell <nathan@acm.org> | 2020-08-04 09:24:02 -0700 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2020-08-04 09:32:18 -0700 |
commit | 0f4f9bc12201c9cda9558295a4fef58fe0246b44 (patch) | |
tree | 0fe04fa020cb1b07bb207d25f0ceaac11bec9ef9 /gcc/omp-expand.c | |
parent | 35ffd4d16d7e3dbba297da788414a673530b7817 (diff) | |
download | gcc-0f4f9bc12201c9cda9558295a4fef58fe0246b44.zip gcc-0f4f9bc12201c9cda9558295a4fef58fe0246b44.tar.gz gcc-0f4f9bc12201c9cda9558295a4fef58fe0246b44.tar.bz2 |
c++: fix template parm count leak
I noticed that we could leak parser->num_template_parameter_lists with
erroneous specializations. We'd increment, notice a problem and then
bail out. This refactors cp_parser_explicit_specialization to avoid
that code path. A couple of tests get different diagnostics because
of the fix. pr39425 then goes to unbounded template instantiation
and exceeds the implementation limit.
gcc/cp/
* parser.c (cp_parser_explicit_specialization): Refactor
to avoid leak of num_template_parameter_lists value.
gcc/testsuite/
* g++.dg/template/pr39425.C: Adjust errors, (unbounded
template recursion).
* g++.old-deja/g++.pt/spec20.C: Remove fallout diagnostics.
Diffstat (limited to 'gcc/omp-expand.c')
0 files changed, 0 insertions, 0 deletions