[cfe-commits] [PATCH] Add suggestion for replacing '.' with '->' in failed member reference

Jordan Rose jediknil at belkadan.com
Wed Apr 25 13:12:13 PDT 2012


>> The text seems reasonable, though it's a bit long in your example in
>> part because of the names - but also because we're printing the fully
>> qualified name of the base expression's type. Is there any
>> reasonable/easy way we can print something closer to/exactly as the
>> user wrote? ("wrapped_ptr<Worker>") - I'm not sure whether that's a
>> good thing to do, or how it compares to other diagnostics that might
>> have this problem.
>> 
> It's apparently how the diagnostics printer renders a DeclContext. While it's kind of ugly in the trivial situation of the unit test, I think we probably want to keep it to avoid name (and namespace) confusion in more complex examples. Particularly when one of the classes is pulled in from a header file. ;)

Sorry for replying late, but this is one of the features of Clang that I really appreciate, and that we advertise on our site (http://clang.llvm.org/diagnostics.html ). I know it'll make diagnostics /even longer/, but this does seem like an appropriate case for "'string' (aka 'std::basic_string...')".

Jordy



More information about the cfe-commits mailing list