[cfe-commits] r65081 - in /cfe/trunk: lib/Basic/Diagnostic.cpp lib/Sema/Sema.cpp test/Sema/declspec.c test/Sema/exprs.c test/Sema/types.c test/SemaCXX/const-cast.cpp test/SemaCXX/constructor-initializer.cpp test/SemaCXX/destructor.cpp test/SemaCXX/inherit.cpp test/SemaCXX/overloaded-operator-decl.cpp test/SemaCXX/typedef-redecl.cpp test/SemaTemplate/class-template-decl.cpp

Chris Lattner clattner at apple.com
Sun Feb 22 21:28:40 PST 2009

On Feb 22, 2009, at 11:29 AM, Sebastian Redl wrote:

> Chris Lattner wrote:
>> Author: lattner
>> Date: Thu Feb 19 17:45:49 2009
>> New Revision: 65081
>> URL: http://llvm.org/viewvc/llvm-project?rev=65081&view=rev
>> Log:
>> Fix a long standard problem with clang retaining "too much" sugar
>> information about types.  We often print diagnostics where we say
>> "foo_t" is bad, but the user doesn't know how foo_t is declared
>> (because it is a typedef).  Fix this by expanding sugar when present
>> in a diagnostic (and not one of a few special cases, like vectors).
> Hmm ... this worries me when I think about C++ templates. Printing the
> unsugared typename would make template diagnostics completely
> unreadable, e.g. print the dreaded std::basic_string<char,
> std::allocator<char>, std::char_traits<char> > instead of (or in
> addition to) std::string.

I completely agree.  This is also wrong for a variety of other types  
for other reasons.  I'm perfectly fine with a "whitelist" of types  
that we only want to show the pretty versions of, and we already do  
that for the c/objc cases right now.


More information about the cfe-commits mailing list