public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28371]  New: pointer to function type mistaken when template functions are involved
@ 2006-07-13 15:45 joaquin at tid dot es
  2006-07-13 15:51 ` [Bug c++/28371] " rguenth at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: joaquin at tid dot es @ 2006-07-13 15:45 UTC (permalink / raw)
  To: gcc-bugs

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

The following snippet:

#include <iostream>

void foo(){}
template<typename T>void bar(){}

template<typename T>
void test(const T&)
{
  std::cout<<typeid(T).name()<<std::endl;
}

int main()
{
  test(&foo);
  test(&bar<int>);
}

produces this oputput on gcc version 3.2 20020927
(prerelease) under Cygwin:

PFvvE
FvvE

But the two lines should be identical --in both
cases, the deduced T should be void(*)().
Although it is not immediately apparent in
the testcase provided, what happens is that the
second type is taken as void(), i.e. the pointer
somehow is dropped.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


-- 
           Summary: pointer to function type mistaken when template
                    functions are involved
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: joaquin at tid dot es


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


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

* [Bug c++/28371] pointer to function type mistaken when template functions are involved
  2006-07-13 15:45 [Bug c++/28371] New: pointer to function type mistaken when template functions are involved joaquin at tid dot es
@ 2006-07-13 15:51 ` rguenth at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-07-13 15:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2006-07-13 15:51 -------
Fixed (at least) in 3.3.3.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.3.3


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


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

end of thread, other threads:[~2006-07-13 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13 15:45 [Bug c++/28371] New: pointer to function type mistaken when template functions are involved joaquin at tid dot es
2006-07-13 15:51 ` [Bug c++/28371] " rguenth at gcc dot gnu dot org

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).