public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44239]  New: Spurious partial explicit specialization when taking the address of a template function.
@ 2010-05-22  8:11 cjoldfield at gmail dot com
  2010-05-22  9:19 ` [Bug c++/44239] " paolo dot carlini at oracle dot com
  2010-05-22 17:33 ` cjoldfield at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: cjoldfield at gmail dot com @ 2010-05-22  8:11 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1223 bytes --]

Problem:

template <class T>
const T& max(const T& x, const T& y){
   return x > y ? x : y;
}

template <class T, class C>
const T& max(const T& x, const T& y, C comp){
   return comp(x, y) ? y : x;

}

template <class R, class A0, class A1>
struct functor{
   template <class F>
   functor(F f) : f(f) {}
   R (*f)(A0, A1);
};

int main(void){
   functor<const int&, const int&, const int&> func(&max<int>); 
   return 0;
}

results in "error: no matching function for call to ‘functor<const int&, const
int&, const int&>::functor(<unresolved overloaded function type>)’"  Only
candidate constructor is the default copy constructor.

After removing the two parameter max template, compiles clean.  The code is
boiled down from a problem using std::max with boost::function.


-- 
           Summary: Spurious partial explicit specialization when taking the
                    address of a template function.
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cjoldfield at gmail dot com


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/44239] Spurious partial explicit specialization when taking the address of a template function.
  2010-05-22  8:11 [Bug c++/44239] New: Spurious partial explicit specialization when taking the address of a template function cjoldfield at gmail dot com
@ 2010-05-22  9:19 ` paolo dot carlini at oracle dot com
  2010-05-22 17:33 ` cjoldfield at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-05-22  9:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from paolo dot carlini at oracle dot com  2010-05-22 09:18 -------
This works fine in 4_4-branch, 4_5-branch and mainline. I don't think it's a
regression, and in any case, 4_3-branch is close to its end of life.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|                            |4.4.1 4.5.0 4.6.0
         Resolution|                            |WORKSFORME


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/44239] Spurious partial explicit specialization when taking the address of a template function.
  2010-05-22  8:11 [Bug c++/44239] New: Spurious partial explicit specialization when taking the address of a template function cjoldfield at gmail dot com
  2010-05-22  9:19 ` [Bug c++/44239] " paolo dot carlini at oracle dot com
@ 2010-05-22 17:33 ` cjoldfield at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: cjoldfield at gmail dot com @ 2010-05-22 17:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from cjoldfield at gmail dot com  2010-05-22 17:33 -------
*** Bug 44243 has been marked as a duplicate of this bug. ***


-- 


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-22 17:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-22  8:11 [Bug c++/44239] New: Spurious partial explicit specialization when taking the address of a template function cjoldfield at gmail dot com
2010-05-22  9:19 ` [Bug c++/44239] " paolo dot carlini at oracle dot com
2010-05-22 17:33 ` cjoldfield at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).