On Wednesday, July 04, 2012 2:37 AM, Jordan Rose wrote:
> On Jul 3, 2012, at 3:23 PM, Andy Gibbs wrote:
>> Good to commit?
>
> LGTM. Wondering about this case:
>
> int x; // expected-note + {{...}}
> ...
> // expected-note@<line> {{...}}
>
> ...but I'm willing to say that if you do this to yourself it
> shouldn't surprise you if it doesn't work.
Yes, its a greedy match algorithm. The above case would always
generate a missing but expected diagnostic message since the "one
or more" directive will have gobbled up all the occurrences and
so the second directive will match nothing.
Alternatively, this:
// expected-note@<line> {{...}}
...
int x; // expected-note + {{...}}
will effectively mean a "2 or more" match.
I think we leave this to the user to sort out. At least the
diagnostics from -verify will say where the error is...
For this code:
int x; // expected-note + {{previous}}
double x; // expected-error {{redefinition}}
float x; // expected-error {{redefinition}}
// expected-note@1 {{previous}}
the output is:
error: 'note' diagnostics expected but not seen:
Line 1 (directive at 1.c:4): previous
1 error generated.
So the user knows to look to line 4 for the mismatched directive.
Cheers
Andy
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits