This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]