This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++ bug 57
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>, "gcc-bugs at gcc dot gnu dot org" <gcc-bugs at gcc dot gnu dot org>
- Cc: "sebor at roguewave dot com" <sebor at roguewave dot com>, "jason at redhat dot com" <jason at redhat dot com>
- Date: Wed, 21 Nov 2001 09:07:32 -0800
- Subject: Re: c++ bug 57
[Get raw message]
--On Wednesday, November 21, 2001 10:22:52 AM +0000 Nathan Sidwell
<nathan@codesourcery.com> wrote:
struct B {
void foo (int = A<T,U>::n);
template <class T, class U> struct A { static const int n;};
};
This should be invalid. The standard should say specifically that the
default argument expression is taken to be the next sequence of tokens
up to an unnested `,', where nested means nested within parentheses,
braces, or square brackets.
The EDG front end rejects this code, too.
> struct C {
> static int Foo (int = Baz ());
> static int Baz (int = Foo ());
> };
>
This should be invalid, too. The standard should say that you iterate
through the members, in declaration order, after the original class
scan, and fill in default arguments at that time. Until the default
arguments are filled in, pretend there are none.
This is the algorithm used by the EDG front end, I believe.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com