public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <oliva@dcc.unicamp.br>
To: mmitchell@usa.net
Cc: jbuck@synopsys.com, als@tusc.com.au, egcs@cygnus.com
Subject: Re: error message formatting
Date: Thu, 16 Apr 1998 18:39:00 -0000	[thread overview]
Message-ID: <orwwcp8r1d.fsf@narizinho.lsd.dcc.unicamp.br> (raw)
In-Reply-To: <199804160703.AAA01943@mail.earthlink.net>

Mark Mitchell writes:

> We have to be careful that we don't introduce ambiguity in the
> process.  It may be possible to do so by dropping defaulted arguments,

>   template <class T, class U = T**>
>   void f();

>   template <class T*, class U = T*>
>   void f();

`classs T*' is not a valid template argument declaration.

However, the raised issue is a valid one.  Suppose one declares:

template <typename T, int i = 1> void f();
template <typename T, char e = '\0'> void f();

Then he calls f<int>().  The compiler must report an ambiguity but, if 
we remove trailing default arguments, the error message would look
like:

?:?:Template function call is ambiguous.  Available specializations are:
?:?:	f<int>()
?:?:	f<int>()

This would seem rather confusing, although line numbers might help.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil


  reply	other threads:[~1998-04-16 18:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-14 15:23 Anthony Shipman
1998-04-15  7:39 ` David Cogen
1998-04-15 14:53   ` Mark Schaefer
1998-04-15 14:53     ` David Cogen
1998-04-15 23:03       ` Joe Buck
1998-04-16  6:10         ` David Cogen
1998-04-16  2:26       ` Per Bothner
1998-04-16 16:34       ` Anthony Shipman
1998-04-17  2:23         ` Pieter Nagel
1998-04-17 14:42         ` David Cogen
1998-04-15 23:03     ` Joe Buck
1998-04-16 16:34   ` Craig Burley
1998-04-15 14:53 ` Joe Buck
1998-04-16  0:01   ` Mark Mitchell
1998-04-16 18:39     ` Alexandre Oliva [this message]
1998-04-16 22:46       ` Best optimization on UltraSparc? Dax Kelson
1998-04-16 23:59       ` error message formatting Mark Mitchell
1998-04-16  5:58   ` David Cogen
1998-04-16 13:53     ` David Cogen
1998-04-21 17:06   ` Lassi A. Tuura
1998-04-15 14:53 Mike Stump
1998-04-15 20:39 ` Joe Buck
1998-04-16 10:51   ` Per Bothner
1998-04-16 13:53     ` Joe Buck
1998-04-16  5:58 ` David Cogen
1998-04-16 14:20 Mike Stump
1998-04-20 11:44 Kaz Kylheku

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=orwwcp8r1d.fsf@narizinho.lsd.dcc.unicamp.br \
    --to=oliva@dcc.unicamp.br \
    --cc=als@tusc.com.au \
    --cc=egcs@cygnus.com \
    --cc=jbuck@synopsys.com \
    --cc=mmitchell@usa.net \
    /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).