[cfe-dev] Straw poll: -verify and fatal errors
andyg1001 at hotmail.co.uk
Mon Jul 9 14:14:25 PDT 2012
I am working on a series of patches to enhance and fix the -verify feature
of clang, but one thing in particular has raised some questions which myself
and Mr. Rose would appreciate some input on!
For those not familiar with the -verify feature, here is a very brief
description taken from the clang internals web-page: "Instead of formatting
and printing out the diagnostics, -verify just captures and remembers the
diagnostics as they fly by. Then -verify compares the list of produced
diagnostics to the list of expected ones. If they disagree, it prints out
its own output." It is a feature commonly used in writing test cases for
clang, but also has the potential to be used for non-related projects.
The question at hand here relates to how -verify should handle fatal errors
generated within test cases. At the moment, -verify doesn't handle them at
all: it cannot be used to check for the generation of fatal errors, nor does
it provide any diagnostics back to the user.
So, which would people rather?
1. -verify should not be used to check for fatal errors but instead should
halt the test case with a diagnostic direct to the user relating to the
fatal error, similar to normal compiler operation
2. -verify should be capable of checking for the generation of fatal errors
in the same way as it can for all other errors/warnings/etc.
Both routes are feasible and patches (or partial patches!) exist for both:
the question is more which is the better route to take. Better can mean
either from a user's / test case writer's point of view, or from a technical
point of view -- or both!
Thanks for any and all feedback!
More information about the cfe-dev