public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: bangerth@dealii.org
To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org,
	rl@tempest-sw.com
Subject: Re: c++/8427: internal error on ambiguous function template
Date: Mon, 04 Nov 2002 07:17:00 -0000	[thread overview]
Message-ID: <20021104151743.26504.qmail@sources.redhat.com> (raw)

Synopsis: internal error on ambiguous function template

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Mon Nov  4 07:17:42 2002
State-Changed-Why:
    gcc 3.3 now says
    -----------------------------
    home/bangerth> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c gcc01.cpp -o /dev/null
    gcc01.cpp: In function `int main()':
    gcc01.cpp:8: error: call of overloaded `f(g<2>)' is ambiguous
    gcc01.cpp:3: error: candidates are: void f(g<(i / j)>) [with int i = 4, int j = 2]
    gcc01.cpp:4: error:                 void f(g<j>) [with int i = 4, int j = 2]
    
    The message seems correct to me. I think you're just out
    of luck here, since the language does not provide you with
    a way to disambiguate which function you wanted to call.
    
    Regards
      W.
    
    
    Original code:
    template<int i> struct g {};
    
    template<int i, int j> void f(g<i/j>) { }
    template<int i, int j> void f(g<j>) { }
    
    int main()
    {
      f<4,2>(g<4/2>());
    }
    

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8427


             reply	other threads:[~2002-11-04 15:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-04  7:17 bangerth [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-04  7:13 bangerth
2002-11-02  7:46 Ray Lischner
2002-11-01 15:35 bangerth
2002-11-01 15:26 rl

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=20021104151743.26504.qmail@sources.redhat.com \
    --to=bangerth@dealii.org \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    --cc=rl@tempest-sw.com \
    /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).