The following invalid code is accepted by g++: struct exception {}; template <typename T> void foo() throw(exception); template <typename T> void foo(); // Error: exception-specification mismatch struct bar { template <typename T> friend void foo(); // Error: exception-specification mismatch };
Confirmed, related to PR 13699 and PR 12255. The first part of the testcase is rejected in 2.95.3. The second part is not really a regression.
Subject: Bug 24817 Author: mmitchel Date: Mon Nov 14 05:45:45 2005 New Revision: 106884 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106884 Log: PR c++/24817 * decl.c (check_redeclaration_exception_specification): New function. (duplicate_decls): Use it. * error.c (fndecl_to_string): Print the template parameter list. PR c++/24817 * g++.dg/eh/spec8.C: New test. Added: trunk/gcc/testsuite/g++.dg/eh/spec8.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c trunk/gcc/cp/error.c trunk/gcc/testsuite/ChangeLog
Fixed in 4.1. See http://gcc.gnu.org/ml/gcc-patches/2005-11/msg00945.html for rationale for not fixing this PR in earlier releases.
Lets close it as fixed then.