[Bug c++/37719] New: incorrect type on warning of mismatched exception specification with templates
yacwroy at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Oct 2 18:00:00 GMT 2008
========= 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
More information about the Gcc-bugs
mailing list