Questions about a constant array reference in the C++ front end
Zack Weinberg
zack@codesourcery.com
Tue May 10 07:51:00 GMT 2005
Paul Schlie <schlie@comcast.net> writes:
>> From: Mark Mitchell <mark@codesourcery.com>
>> static const int i = f();
>
> Admittedly didn't think that was legal, as I though all "static const"
> initializer values needed to be resolvable at compile time, directly or
> indirectly from literal values by the front-end, or otherwise invalid.
In C what you say is true; in C++ initializers may execute arbitrary
code.
zw
More information about the Gcc
mailing list