[cfe-commits] [Patch] New warning for scopes that start in one file and end in another.

Richard Trieu rtrieu at google.com
Tue Feb 21 20:47:51 PST 2012


On Fri, Feb 17, 2012 at 4:51 AM, Manuel Klimek <klimek at google.com> wrote:

> On Thu, Feb 16, 2012 at 5:31 PM, Matt Beaumont-Gay <matthewbg at google.com>
> wrote:
> > On Thu, Feb 16, 2012 at 02:46, Sebastian Redl
> > <sebastian.redl at getdesigned.at> wrote:
> >>
> >> On 16.02.2012, at 08:11, Matt Beaumont-Gay wrote:
> >>
> >>> On Wed, Feb 15, 2012 at 20:47, Eli Friedman <eli.friedman at gmail.com>
> wrote:
> >>>> Mechanically, the patch looks fine...
> >>>>
> >>>> What sort of testing have you done with this patch?  Has this caught
> >>>> any interesting issues in existing code?  If not, why is this warning
> >>>> useful?  Any false positives we should be aware of?
> >>>
> >>> I imagine that this will not have a lot of hits on checked-in code.
> >>> However, I can see it being very useful during development, e.g. when
> >>> you forget to close a namespace at the bottom of a header file.
> >>
> >> But you'd most likely get an error anyway, complaining about unmatched
> braces.
> >
> > Maybe, maybe not -- failing to close a namespace can cause a lot of
> > cascading errors, which could easily hit -ferror-limit.
>
> How does this patch address that? It's still only warning on the
> closing brace, right?
>
> Cheers,
> /Manuel
>
>  This patch moves the checking from the parser to the lexer.  This allows
the error to be emitted at the end of the file instead of at the closing
brace.  Since it doesn't know where the closing brace is, the warning will
only point to the opening brace.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120221/d99697e1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scopes.patch
Type: application/octet-stream
Size: 5218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120221/d99697e1/attachment.obj>


More information about the cfe-commits mailing list