LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 26205 - google-readability-braces-around-statements introduces double braces
Summary: google-readability-braces-around-statements introduces double braces
Status: RESOLVED DUPLICATE of bug 26181
Alias: None
Product: clang-tools-extra
Classification: Unclassified
Component: clang-tidy (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-19 03:30 PST by Richard
Modified: 2016-04-15 08:56 PDT (History)
4 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard 2016-01-19 03:30:52 PST
On the attached source code (from https://github.com/LegalizeAdulthood/iterated-dynamics), run google-readability-braces-around-statements on hc/helpcom.cpp.  You get double braces everywhere:

diff --git a/hc/helpcom.cpp b/hc/helpcom.cpp
index db60814..960819a 100644
--- a/hc/helpcom.cpp
+++ b/hc/helpcom.cpp
@@ -36,8 +36,10 @@ void setint(char *ptr, int n)
 
 bool is_hyphen(char const *ptr)   /* true if ptr points to a real hyphen */
 {   /* checkes for "--" and " -" */
-    if (*ptr != '-')
+    if (*ptr != '-') { {
         return false;    /* that was easy! */
+}
+}
 
     --ptr;
 
@@ -51,10 +53,10 @@ int _find_token_length(char const *curr, unsigned len, int *size, int *width)
     int _width = 0;
     int tok;
 
-    if (len == 0)
+    if (len == 0) { {
         tok = TOK_DONE;
 
-    else
+    } } else
     {
         switch (*curr)
         {


etc.
Comment 1 Malcolm Parsons 2016-04-15 08:56:38 PDT

*** This bug has been marked as a duplicate of bug 26181 ***