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: unassignedclangb...@nondot.org
          Reporter: l...@derickrethans.nl
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to