This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37719] New: incorrect type on warning of mismatched exception specification with templates
- From: "yacwroy at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Oct 2008 17:59:33 -0000
- Subject: [Bug c++/37719] New: incorrect type on warning of mismatched exception specification with templates
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
========= 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