[cfe-commits] r50197 - /cfe/trunk/lib/Analysis/BugReporter.cpp

Chris Lattner clattner at apple.com
Sun May 4 21:15:17 PDT 2008


On May 4, 2008, at 8:57 PM, Ted Kremenek wrote:
>>>>> URL: http://llvm.org/viewvc/llvm-project?rev=50197&view=rev
>>>>> Log:
>>>>> For case statements involving enums, BugReporter now generates  
>>>>> PathDiagnostics
>>>>> that say that we are jumping to "case a" instead of "case 0".
>>>>>
>>>>> This is a feature implementation for <rdar://problem/5880430>.
>>>>
>>>> Nifty, is there any way to write regtests for these sorts of  
>>>> presentation issues?
>>>>
>>>> -Chris
>>>
>>> I think so.  Checking the status code of grep?
>>
>> Can you use 'expected-warning {{..}}' syntax with the non-html  
>> diagnostic emitter?
>
> Yes, but for non-html diagnostics we only emit diagnostics for the  
> last piece of the path, not the entire path.  We can easily write a  
> "PathTextDiagnostic" that renders an entire path as diagnostics for  
> the TextDiagnosticClient (which could then be verified).

Maybe the non-html version of the diagnosics should tag the other  
parts as 'informational' or something like that?  That way, you could  
do 'expected-informational'.

We have a similar situation for things like:

int foo() {
    (4    ;
}

$ clang t.c
t.c:4:10: error: expected ')'
    (4    ;
          ^
t.c:4:4: error: to match this '('
    (4    ;
    ^

Where the second diagnostic is really a continuation of the first...  
there is only one error.

-Chris



More information about the cfe-commits mailing list