Jason Merrill <ja...@redhat.com> writes: > On Thu, Dec 19, 2019 at 9:05 AM Christophe Lyon <christophe.l...@linaro.org> > wrote: > >> On Tue, 17 Dec 2019 at 22:46, Jason Merrill <ja...@redhat.com> wrote: >> > >> > The variable templates patch way back when forgot to add handling here. >> The >> > simplest answer seems to be recursing to the underlying declaration. >> > >> > Tested x86_64-pc-linux-gnu, applying to trunk. >> > >> > * decl.c (redeclaration_error_message): Recurse for variable >> > templates. >> >> >> Hi, >> >> This patch introduced regressions on aarch64: >> g++.dg/ext/sve-sizeless-1.C -std=gnu++14 (test for errors, line 77) >> g++.dg/ext/sve-sizeless-1.C -std=gnu++17 (test for errors, line 77) >> g++.dg/ext/sve-sizeless-1.C -std=gnu++2a (test for errors, line 77) >> g++.dg/ext/sve-sizeless-2.C -std=gnu++14 (test for errors, line 77) >> g++.dg/ext/sve-sizeless-2.C -std=gnu++17 (test for errors, line 77) >> g++.dg/ext/sve-sizeless-2.C -std=gnu++2a (test for errors, line 77) >> > > The code I removed that gave that error was from 2004, predating alias > templates; I can't see anything in the standard to prohibit redefining an > alias template to refer to the same type, as you definitely can with a > non-template alias or typedef, and other compilers allow it. So I think > the tests should be fixed.
OK, I've committed the below under the obvious rule. Thanks, Richard 2019-12-19 Richard Sandiford <richard.sandif...@arm.com> gcc/testsuite/ * g++.dg/ext/sve-sizeless-2.C: Don't expect an error for alias templates. Index: gcc/testsuite/g++.dg/ext/sve-sizeless-2.C =================================================================== --- gcc/testsuite/g++.dg/ext/sve-sizeless-2.C 2019-12-19 17:23:12.000000000 +0000 +++ gcc/testsuite/g++.dg/ext/sve-sizeless-2.C 2019-12-19 17:23:19.494761773 +0000 @@ -74,7 +74,7 @@ struct templated_struct4 { #if __cplusplus >= 201103L template<int N> using typedef_sizeless1 = svint8_t; -template<int N> using typedef_sizeless1 = svint8_t; // { dg-error {redefinition of 'template<int N> using typedef_sizeless1 = svint8_t'} "" { target c++11 } } +template<int N> using typedef_sizeless1 = svint8_t; template<typename T> using array = T[2]; #endif