[cfe-dev] Status of "-parse-print-callbacks"

Sebastian Redl sebastian.redl at getdesigned.at
Tue Mar 24 01:08:17 PDT 2009


On Tue, 24 Mar 2009 00:42:03 -0700, Jon Simons <simonsj at ccs.neu.edu> wrote:
> I am wondering, what is the status of using the "-parse-print-callbacks"
> flag for clang-cc?
> 
> Should it succeed and fail when normal parsing would succeed and fail?
> 

For C, yes.

> I ask because I see discrepancies:
> 
>    # cat test.c
>    typedef struct foo { int x; } foo;
>    void test() {
>      foo *foo;
>      foo->x = 0;
>    }
>    # clang-cc test.c
>    # clang-cc -parse-print-callbacks test.c 1>/dev/null
>    test.c:4:6: error: expected identifier or '('
>      foo->x = 0;
>         ^
>    test.c:4:6: error: parse error
>    2 diagnostics generated.
> 
> Is this something that warrants a PR and/or following up on?  Or is
> "-parse-print-callbacks" something that might not be worth updating
> because C++ parsing is still in development?
> 

This looks like a bug. C++ parsing shouldn't affect the callback printer
for C. There's little chance the callback printer will ever support C++
(too much work, too little gain), but that's a different story.



More information about the cfe-dev mailing list