gcc-c++ handling of default arguments

Michael Cronenworth mike@cchtml.com
Mon Dec 8 16:17:00 GMT 2014


On 12/08/2014 10:08 AM, Thomas Pircher wrote:
>>
>
> Shouldn't objWbemServices also have a default argument in this code? I think I
> found the relevant part in the C++-14 draft:
>
> 8.3.6 Default arguments:
> In a given function declaration, each parameter subsequent to a parameter with a
> default argument shall have a default argument supplied in this or a previous
> declaration or shall be a function parameter pack.

Yes, that is what gcc is telling me. I've been told by MinGW-64 (Kai Tietz) that 
he doesn't think he needs to supply a default for that argument for Windows builds.

Is every argument expected to have a default value? Is there a flag to make gcc 
relax on this requirement? I see -fms-extensions doesn't control this.



More information about the Gcc-help mailing list