public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/13833] New: [3.4/3.5 regression] Conversion problem in template function
Date: Fri, 23 Jan 2004 15:46:00 -0000	[thread overview]
Message-ID: <20040123154602.13833.bangerth@dealii.org> (raw)

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


             reply	other threads:[~2004-01-23 15:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-23 15:46 bangerth at dealii dot org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040123154602.13833.bangerth@dealii.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).