https://bugs.llvm.org/show_bug.cgi?id=50707
Bug ID: 50707
Summary: SplitEmptyRecord also affects whether to
SplitEmptyFunction
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Formatter
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Created attachment 24952
--> https://bugs.llvm.org/attachment.cgi?id=24952&action=edit
test case
Given the following .clang-format file:
---
BasedOnStyle: Microsoft
AccessModifierOffset: '-4'
AllowAllConstructorInitializersOnNextLine: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
AllowShortFunctionsOnASingleLine: Empty
BreakConstructorInitializers: AfterColon
ColumnLimit: '80'
Language: Cpp
Standard: Latest
BraceWrapping:
SplitEmptyFunction: true
SplitEmptyRecord: false
...
Long function bodies are not becoming
{
}
Expects (test.cc): --
class Short
{};
class Test
{
public:
Test() :
bEnabled(false),
eDestination(eOutputDestination::file),
uiMaxSize(DEFAULT_MAX_LOGGER_FILE_SIZE)
{
}
void memFun(void *caller, std::function<int(char const *, char)> cb,
std::tuple<bool, std::string> param)
{
}
};
void regularFun(void *caller, std::function<int(char const *, char)> cb,
std::tuple<bool, std::string> param)
{
}
Got: --
class Short
{};
class Test
{
public:
Test() :
bEnabled(false),
eDestination(eOutputDestination::file),
uiMaxSize(DEFAULT_MAX_LOGGER_FILE_SIZE)
{}
void memFun(void *caller, std::function<int(char const *, char)> cb,
std::tuple<bool, std::string> param)
{}
};
void regularFun(void *caller, std::function<int(char const *, char)> cb,
std::tuple<bool, std::string> param)
{}
Trying out all 4 combinations of SplitEmptyFunction and SplitEmptyRecord and
got a surprising result.
SplitEmptyFunction: false
SplitEmptyRecord: false
Good
SplitEmptyFunction: true
SplitEmptyRecord: false
Bad, same as above
SplitEmptyFunction: false
SplitEmptyRecord: true
Good
SplitEmptyFunction: true
SplitEmptyRecord: true
Good
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs