[cfe-commits] [PATCH] C++0x: Allow static member access to non-static fields in a sizeof() expression.

Jakub Wieczorek fawek at fawek.net
Sat Nov 20 13:09:55 PST 2010


Hi,

I'm attaching a patch that makes it possible to access non-static data
members in a static context in unevaluated expressions (such as
sizeof), e.g.:

struct a { int b; };
char c[sizeof(a::b)];

This isn't permitted in C++03 but the rule has been relaxed in C++0x [1].

Best regards,
Jakub Wieczorek

[1] This is covered in the [expr.prim.general] section of the C++0x
draft, point 5.1.1.10.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cxx-0x-51110.patch
Type: text/x-patch
Size: 3367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20101120/2ca82473/attachment.bin>


More information about the cfe-commits mailing list