public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13833] New: [3.4/3.5 regression] Conversion problem in template function
@ 2004-01-23 15:46 bangerth at dealii dot org
  2004-01-23 16:50 ` [Bug c++/13833] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2004-01-23 15:46 UTC (permalink / raw)
  To: gcc-bugs

In this code 
--------------------- 
struct X { 
    template <typename T> 
    X & operator << (const T &t); 
    X & operator<< (int& (*p) (int&)); 
}; 
 
X x; 
 
template <int> void foo () { 
  x << (1 ? "ok" : "failed"); 
} 
 
template void foo<1>(); 
------------------------ 
 
we now get 
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc 
x.cc: In function `void foo()': 
x.cc:10: error: conditional expression between distinct pointer types `const 
char (*)[3]' and `const char (*)[7]' lacks a cast 
 
That sounds bogus to me, though I could be wrong. This is with present 
mainline and tree-ssa (don't have 3.4 checked out right now, but that 
is likely to be affected as well). 3.3 is ok, though. 
 
Note that the same doesn't happen if foo is not a template, which makes 
me even more suspicious. 
 
W.

-- 
           Summary: [3.4/3.5 regression] Conversion problem in template
                    function
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2004-01-26  4:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-23 15:46 [Bug c++/13833] New: [3.4/3.5 regression] Conversion problem in template function bangerth at dealii dot org
2004-01-23 16:50 ` [Bug c++/13833] " pinskia at gcc dot gnu dot org
2004-01-25 21:21 ` mmitchel at gcc dot gnu dot org
2004-01-26  3:05 ` cvs-commit at gcc dot gnu dot org
2004-01-26  3:13 ` cvs-commit at gcc dot gnu dot org
2004-01-26  4:46 ` pinskia 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).