[cfe-dev] Regression when parsing (padding) bitfields.

Richard Smith richard at metafoo.co.uk
Mon Jul 2 12:14:40 PDT 2012


Thanks, fixed in r159549.

On Mon, Jul 2, 2012 at 2:36 AM, Enea Zaffanella <zaffanella at cs.unipr.it>wrote:

> Hello.
>
> When parsing the following program
>
> $ cat bug.c
> struct S {
>    enum V0 { v0 };
>    enum V0 e0 : 8;
>    enum V0 : 4;
>
>    enum V1 { v1 } e1 : 8;
>    enum V2 { v2 } : 4; // Parse error.
> };
>
> recent version of clang accept all but the last (unnamed) bitfield
> declaration, yielding the following error messages:
>
> $ Debug+Asserts/bin/clang -fsyntax-only bug.c
> bug.c:7:18: error: expected
>        ';' after enum
>    enum V2 { v2 } : 4; // Parse error.
>                   ^
>                   ;
> bug.c:7:20: error: type name
>        requires a specifier or qualifier
>    enum V2 { v2 } : 4; // Parse error.
>                     ^
> bug.c:7:20: error: expected
>        member name or ';' after declaration specifiers
>    enum V2 { v2 } : 4; // Parse error.
>                     ^
> bug.c:7:21: error: expected
>        ';' at end of declaration list
>    enum V2 { v2 } : 4; // Parse error.
>                      ^
>                      ;
> 4 errors generated.
>
>
> Previous versions of clang (e.g., up to r158293) were parsing the
> program without generating diagnostics.
>
> Cheers,
> Enea.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120702/50abf76b/attachment.html>


More information about the cfe-dev mailing list