diff options
author | Simon Martin <simon@nasilyan.com> | 2024-08-25 21:59:31 +0200 |
---|---|---|
committer | Simon Martin <simon@nasilyan.com> | 2024-08-26 18:18:31 +0200 |
commit | 26ee954476bef7328d2cf45928c3c9b84df77178 (patch) | |
tree | 4ad4c054e606f303fbd782598ecc9735a6a2819e /gcc/diagnostic-format-json.cc | |
parent | cc372be5d0a8a1665bc5f716458f326b5afad43f (diff) | |
download | gcc-26ee954476bef7328d2cf45928c3c9b84df77178.zip gcc-26ee954476bef7328d2cf45928c3c9b84df77178.tar.gz gcc-26ee954476bef7328d2cf45928c3c9b84df77178.tar.bz2 |
c++: Check template parameters in member class template specialization [PR115716]
We currently ICE upon the following invalid code, because we don't check
that the template parameters in a member class template specialization
are correct.
=== cut here ===
template <typename T> struct x {
template <typename U> struct y {
typedef T result2;
};
};
template<> template<typename U, typename> struct x<int>::y {
typedef double result2;
};
int main() {
x<int>::y<int>::result2 xxx2;
}
=== cut here ===
This patch fixes the PR by calling redeclare_class_template.
PR c++/115716
gcc/cp/ChangeLog:
* pt.cc (maybe_process_partial_specialization): Call
redeclare_class_template.
gcc/testsuite/ChangeLog:
* g++.dg/template/spec42.C: New test.
* g++.dg/template/spec43.C: New test.
Diffstat (limited to 'gcc/diagnostic-format-json.cc')
0 files changed, 0 insertions, 0 deletions