Bug#911561: BreakBeforeBraces: Stroustrup does not break after struct/class
Marius Mikucionis
mmikucionis at gmail.com
Sun Oct 21 21:09:53 BST 2018
Package: clang-format-8
Version: 1:8~svn343154-1
Severity: minor
Dear Maintainer,
Here is my sample file format.h:
class test {
int one, two;
test(int one, int two): one{one}, two{two} {}
};
The following command line produces the following output:
clang-format-8 -style="{BreakBeforeBraces: Stroustrup}" format.h
class test {
int one, two;
test(int one, int two) : one{one}, two{two} {}
};
Note that there is no line break after "class test" as described in documentation:
http://clang.llvm.org/docs/ClangFormatStyleOptions.html
As workaround, I can fallback to custom, which works, but it's more verbose:
clang-format-8 -style="{BreakBeforeBraces: Custom, BraceWrapping: {AfterClass: true, AfterStruct: true} }" format.h
class test
{
int one, two;
test(int one, int two) : one{one}, two{two} {}
};
I have tested with version 7 and 6, and they behave identically, which is strange.
Best regards,
Marius
-- System Information:
Debian Release: buster/sid
APT prefers testing
APT policy: (900, 'testing'), (500, 'stable'), (500, 'oldstable'), (50, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.18.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages clang-format-8 depends on:
ii libc6 2.27-6
ii libgcc1 1:8.2.0-8
ii libllvm8 1:8~svn343154-1
ii libstdc++6 8.2.0-8
ii python 2.7.15-3
clang-format-8 recommends no packages.
clang-format-8 suggests no packages.
-- no debconf information
More information about the Pkg-llvm-team
mailing list