[Bug c++/14500] most specialized function template vs. non-template function

gdr at integrable-solutions dot net gcc-bugzilla@gcc.gnu.org
Tue Mar 9 07:21:00 GMT 2004


------- Additional Comments From gdr at integrable-solutions dot net  2004-03-09 07:21 -------
Subject: Re:  most specialized function template vs. non-template function

"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| ------- Additional Comments From bangerth at dealii dot org  2004-03-09 05:18 -------
| Hm, I have a hard time understanding what's going on. Would you 
| mind posting a self-contained example that doesn't make use 
| of odd include files that contain using namespace stuff? 

Try with this:

   namespace A {
     template<class T> X { };

     template<class T>
       void f(X<T>&);            // #1
   }

  namespace B {
    using namespace A __attribute__((trustme));
    
    template<class T>
      void f(T&);               // #2
  }

  struct foo { };

  namespace B {
    template<>
      void(X<foo>&);            // #3
  }

  B::X<int> x;
  B::f(x);                      // calls #2 instead of #3

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14500



More information about the Gcc-bugs mailing list