========= test/test.cpp ========== template <typename T> class foo { void bar() throw(int); };
template <> void foo<int>::bar() throw(float) {} ========= COMMAND ========== g++ -c -o test/test.o test/test.cpp -Wall ========= OUTPUT ========== test/test.cpp:7: error: declaration of âvoid foo<T>::bar() throw (int) [with T = int]â throws different exceptions test/test.cpp:3: error: from previous declaration âvoid foo<T>::bar() throw (int) [with T = int]â ======== test.ii ========= # 1 "test/test.cpp" # 1 "<built-in>" # 1 "<command-line>" # 1 "test/test.cpp" template <typename T> class foo { void bar() throw(int); }; template <> void foo<int>::bar() throw(float) {} =========================== first line should be throw (float) The error comes from in "gcc/cp/decl.c" in function check_redeclaration_exception_specification() on line 1097, but I don't know how to debug it yet. -- Summary: incorrect type on warning of mismatched exception specification with templates Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: yacwroy at gmail dot com GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37719