From b30ae8037dd891566decdadbde041d8f406ecef6 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 10 Apr 2018 13:40:35 +0000 Subject: [PATCH] re PR c++/24314 (Extra "template<>" in partial specialization is compiled successfuly.) 2018-04-10 Paolo Carlini PR c++/24314 * g++.dg/parse/template29.C: New. From-SVN: r259273 --- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/g++.dg/parse/template29.C | 31 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 gcc/testsuite/g++.dg/parse/template29.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 11e18865164..80ad244e3e6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-04-10 Paolo Carlini + + PR c++/24314 + * g++.dg/parse/template29.C: New. + 2018-04-10 Bin Cheng PR testsuite/85190 diff --git a/gcc/testsuite/g++.dg/parse/template29.C b/gcc/testsuite/g++.dg/parse/template29.C new file mode 100644 index 00000000000..46033cbe9de --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/template29.C @@ -0,0 +1,31 @@ +// PR c++/24314 + +// The base template. +template +struct A +{ + int select() { return 0; } +}; + +//Extra "template<>" +template <> +template <> +template <> +template <> +template <> +template <> +template <> +template <> +template <> +template <> +template <> +template +struct A // { dg-error "too many template-parameter-lists" } +{ + int select() { return 1; } +}; + +int main() +{ + return A().select(); +} -- 2.30.2