This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Const in default function arguments?
- From: Eric Lemings <elemings at lemings dot com>
- To: eljay at adobe dot com, eric at lemings dot com, gcc-help at gcc dot gnu dot org
- Date: Fri, 4 Apr 2003 11:08:25 -0700
- Subject: Re: Const in default function arguments?
void foo (int i) {
++i;
}
This function foo doesn't make sense either but it's not a
compile error. Just because something doesn't make sense
doesn't mean it's illegal. Sounds like the non-const
parameter should be a warning, not an error.
An error means that it's illegal and the standard defines
what is legal and what is not. Can somebody not point to
the standard that says you can't use a default function
argument for a non-const parameter?
Thanks.