This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/3784: function not found if integer template parameterdeclared as unsigned in a different function


The following reply was made to PR c++/3784; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-bugs@gcc.gnu.org, <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: c++/3784: function not found if integer template parameter
 declared as unsigned in a different function
Date: Tue, 5 Nov 2002 14:30:31 -0600 (CST)

 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
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]