[llvm-bugs] [Bug 41807] New: clang-format: resulted in multi-line comment warning
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed May 8 23:32:40 PDT 2019
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: unassignedclangbugs at nondot.org
Reporter: Shahzad.Malik.Muzaffar at cern.ch
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
neeilans at live.com, richard-llvm at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190509/c0173147/attachment.html>
More information about the llvm-bugs
mailing list