This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: c++/1046
- To: Craig Rodrigues <rodrigc at mediaone dot net>
- Subject: Re: c++/1046
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- Date: Mon, 12 Mar 2001 00:06:22 -0500
- Cc: libstdc++ at gcc dot gnu dot org
- References: <20010311143815.A25757@mediaone.net>
On Sun, Mar 11, 2001 at 02:38:15PM -0500, Craig Rodrigues wrote:
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=1084&database=gcc
I'm assuming that you really do mean 1084, not 1046 like the subject says.
:-)
> Apparently, when used in a parameter list, std::string() is not recognized as
> the invocation of the default constructor.
> I'm not sure if this is a libstdc++ problem or gcc problem.
It's nothing to do with std::string; this is a well-known "problem" of the
C++ language itself. I highly recommend getting a copy of the C++ Standard
and reading [8.2], which discusses this exact issue. It's ambiguity in
the parser -- as noted in the PR for c++/1084.
Somebody just asked on comp.compilers for examples of ambiguity
in C++. I picked this issue for the example in my response,
<URL:http://compilers.iecc.com/comparch/article/01-03-052>. Nobody's
responded to it, incidentally, so I don't know whether there are mistakes
in my article.
Phil
--
pedwards at disaster dot jaj dot com | pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools. Fools are protected by more capable fools.