[Bug c++/13833] New: [3.4/3.5 regression] Conversion problem in template function

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Fri Jan 23 15:46:00 GMT 2004


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



More information about the Gcc-bugs mailing list