[cfe-commits] Patches for clang -ast-print

Eli Friedman eli.friedman at gmail.com
Mon Nov 26 14:11:58 PST 2012


On Sat, Nov 17, 2012 at 10:47 AM, Grzegorz Jablonski <grzejabl at gmail.com> wrote:
> On 11/10/2012 12:35 AM, Eli Friedman wrote:
>>
>> On Wed, Oct 31, 2012 at 9:27 AM, Jordan Rose <jordan_rose at apple.com>
>> wrote:
>>>
>>> [...]
>>>
>>> If you're okay with adding a PrintImplicitNodes bit to PrintingPolicy
>>> that
>>> would be good enough for us. Otherwise we'll have to think of something
>>> else.
>>
>> This seems okay to me.  Grzegorz?
>
> Patch attached.

Sorry about the delayed review.

It doesn't look like your patch sets the PrintImplicitNodes bit
correctly in all the cases we care about; for example, the following
testcase:

struct MyClass10
{
    operator const char *() { return "str"; }
};

void test10(const char *str)
{
    MyClass10* m;
    extern int x;
    extern decltype(test10(*m)) x;
}

currently gives:

<stdin>:10:33: error: redefinition of 'x' with a different type:
'decltype(test10(*m.operator const char *()))' (aka 'void') vs 'int'
    extern decltype(test10(*m)) x;
                                ^
<stdin>:9:16: note: previous definition is here
    extern int x;
               ^

-Eli



More information about the cfe-commits mailing list