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

            Bug ID: 41807
           Summary: clang-format: resulted in multi-line comment warning
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: shahzad.malik.muzaf...@cern.ch
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
                    neeil...@live.com, richard-l...@metafoo.co.uk

Hi,
  Running clang-format with configuration [a] suggested change [b] which when
compiled with gcc 7 generated multi-line comment warning [c].

  Is it a bug in clang-format or we are using wrong configuration?

Thanks,
--Shahzad

[a]
---
Language:        Cpp
BasedOnStyle:  Google
ColumnLimit:     120
NamespaceIndentation: All
SortIncludes:    false
IndentWidth:     2
AccessModifierOffset: -2
PenaltyBreakComment: 30
PenaltyExcessCharacter: 100
AlignAfterOpenBracket: Align
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BinPackParameters: false
AlwaysBreakTemplateDeclarations: Yes
ReflowComments: false
BinPackArguments: false
BinPackParameters: false

[b]
diff --git a/foo.cc b/foo.cc
index 506f1155bb0..f4ce709cfc1 100644
--- a/foo.cc
+++ b/foo.cc
@@ -1,3 +1,3 @@
 #define NLev1                                                                 
    \
-  4   // Number of HalfCylinders in Endcap or number of Shells in Barrel,
which is
+  4   // Number of HalfCylinders in Endcap or number of Shells in Barrel,
which is \
       // bigger

[c]
>gcc --version | head -1
gcc (GCC) 7.4.1 20190129
>clang-format -version
clang-format version 7.1.0 
>gcc -c -Wall x/y/src/foo.cc
x/y/src/foo.cc:2:7: warning: multi-line comment [-Wcomment]
   4   // Number of HalfCylinders in Endcap or number of Shells in Barrel,
which is \
       ^

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to