[cfe-commits] r59601 - in /cfe/trunk: include/clang/Analysis/PathSensitive/BugReporter.h include/clang/Basic/Diagnostic.h lib/Basic/Diagnostic.cpp lib/Sema/SemaDeclCXX.cpp

Chris Lattner clattner at apple.com
Thu Nov 20 10:48:50 PST 2008


On Nov 20, 2008, at 9:41 AM, Douglas Gregor wrote:
>> +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Nov 19 01:32:16 2008
>> @@ -234,7 +234,7 @@
>>      if (Param->getIdentifier())
>>        Diag(Param->getLocation(),
>>             diag::err_param_default_argument_missing_name)
>> -          << Param->getIdentifier()->getName();
>> +          << Param->getIdentifier();
>>      else
>>        Diag(Param->getLocation(),
>>             diag::err_param_default_argument_missing);
>
>
> This makes me wonder... should we have an operator<<(DiagnosticInfo,
> NamedDecl*) to output the name of a declaration? It would use
> NamedDecl::getName() rather than NamedDecl::getIdentifier(), so it
> would work with all kinds of names.

Absolutely.  It and QualTypes are on the todo list - I just need to  
get operator<< to be a free function first (and address some layering  
issues - Diagnostic can't know about ASTs).

-Chris



More information about the cfe-commits mailing list