[Bug c++/24628] New: const-over-non-const identification fails
igodard at pacbell dot net
gcc-bugzilla@gcc.gnu.org
Wed Nov 2 01:17:00 GMT 2005
template<typename T>
void foo(T& t) {}
template<typename T>
void foo(const T& t) {}
template<typename U, int n, typename T>
void bar(T& t) {}
template<typename U, int n, typename T>
void bar(const T& t) {}
int main() {
int i;
const int j = 0;
foo(i);
foo(j);
bar<bool, 5>(i);
bar<bool, 5>(j);
}
gets you
foo.cc: In function `int main()':
foo.cc:17: error: call of overloaded `bar(const int&)' is ambiguous
foo.cc:7: note: candidates are: void bar(T&) [with U = bool, int n = 5, T =
const int]
foo.cc:9: note: void bar(const T&) [with U = bool, int n = 5, T
= int]
--
Summary: const-over-non-const identification fails
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24628
More information about the Gcc-bugs
mailing list