[cfe-commits] [Patch] Add warning for semi-colon after class function definition

Richard Trieu rtrieu at google.com
Wed Jan 25 17:24:16 PST 2012


This patch adds a warning to catch semi-colons after function definitions.
 The motivation of removing extraneous semi-colons is to make it easier to
see which scopes are being ended by a brace.  Function scopes will end with
a plain brace.  Class scopes will end with brace and semi-colon.

class C {
  void F() {};
};

extra-semi.cc:2:14: warning: extra ';' after function definition
[-Wextra-semi]
  void F() {};
             ^
1 warning generated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120125/9f232f0f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extra-semi.patch
Type: text/x-patch
Size: 1663 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120125/9f232f0f/attachment.bin>


More information about the cfe-commits mailing list