[llvm-bugs] [Bug 36722] New: clang-format-6.0 ignores AlignConsecutiveDeclarations and AlignConsecutiveAssignments for section of code

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 14 04:24:15 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=36722

            Bug ID: 36722
           Summary: clang-format-6.0 ignores AlignConsecutiveDeclarations
                    and AlignConsecutiveAssignments for section of code
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm at derickrethans.nl
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Created attachment 20058
  --> https://bugs.llvm.org/attachment.cgi?id=20058&action=edit
Original file

The attached file "bson.c", when processed with the attached clang-format file
".clang-format", produces the following diff (also attached):

--- bson.c      2018-03-14 11:24:38.895642438 +0000
+++ bson.c.formatted    2018-03-14 11:24:49.051771534 +0000
@@ -29,13 +29,13 @@
 #else
        {
                HashPosition pos;
-               zval**       property;
+               zval** property;

                for (i = 0; i < 10; i++) {
-                       char*                         string_key     = NULL;
-                       uint                          string_key_len = 0;
-                       ulong                         num_key        = 0;
-                       zend_class_entry*             map_ce         = NULL;
+                       char* string_key = NULL;
+                       uint string_key_len = 0;
+                       ulong num_key = 0;
+                       zend_class_entry* map_ce = NULL;
                        php_phongo_bson_typemap_types map_type;
                }
        }


This only seems to happen due to some interaction with the code in the
php_phongo_bson_visit_binary function, and only for the #else block. If I
remove the surrounding { .. }, it works as expected. This is of course a
trimmed down version of the function.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180314/d602cc62/attachment.html>


More information about the llvm-bugs mailing list