[patch] Fix PR16354

Richard Smith richard at metafoo.co.uk
Tue Jun 18 11:13:43 PDT 2013


On Tue, Jun 18, 2013 at 8:19 AM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
> The attache testcase makes us reject
>
> struct ABC {
>   static double a;
> };
> register double ABC::a = 1.0;
>
> Suggestions on better error wording are welcome. It would also be nice
> to reference the standard in the comments, but I could not find
> anything appropriate.

[dcl.stc]p2: The auto or register specifiers shall be applied only to
names of variables declared in a block or to function parameters.

You should reject "extern" here too:

[dcl.stc]p6: The extern specifier cannot be used in the declaration of
class members




More information about the cfe-commits mailing list