This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3784: function not found if integer template parameterdeclared as unsigned in a different function
- From: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- To: gcc-bugs at gcc dot gnu dot org, <gcc-gnats at gcc dot gnu dot org>
- Date: Tue, 5 Nov 2002 14:30:31 -0600 (CST)
- Subject: Re: c++/3784: function not found if integer template parameterdeclared as unsigned in a different function
There's definitely going on something fishy here:
-------------------------------------------------
template <typename T, unsigned N> class X { };
template <typename T, int N> void foo1(X<T,N>);
template <typename T, unsigned N> void foo2(X<T,N>);
int main() {
X<float, 2> x;
foo2(x);
}
-------------------------------------------------
This compiles fine if I remove the foo1 function that is not referenced at
all. If I leave it in, I get this:
tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/c++ test.cc
test.cc: In function `int main()':
test.cc:9: error: no matching function for call to `foo2(X<float, 2>&)'
Seems as if on the definition of foo1, something's erroneously
overwritten.
Regards
Wolfgang
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth