This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13089] bug using operator[] for a template class & ISO C++ standard
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Nov 2003 19:04:50 -0000
- Subject: [Bug c++/13089] bug using operator[] for a template class & ISO C++ standard
- References: <20031117183741.13089.olivier.despouys@rte-france.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-17 19:04 -------
The mainline gives this error:
pr13089.cc: In function `int main()':
pr13089.cc:38: error: ISO C++ says that these are ambiguous, even though the worst conversion
for the first is better than the worst conversion for the second:
pr13089.cc:27: note: candidate 1: const T& Array<T, N>::operator[](size_t) const [with T = float,
int N = 48]
pr13089.cc:38: note: candidate 2: operator[](const float*, int) <built-in>
pr13089.cc:38: error: ISO C++ says that these are ambiguous, even though the worst conversion
for the first is better than the worst conversion for the second:
pr13089.cc:27: note: candidate 1: const T& Array<T, N>::operator[](size_t) const [with T = float,
int N = 48]
pr13089.cc:38: note: candidate 2: operator[](const float*, int) <built-in>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13089