Skip to content

Commit 07a78fe

Browse files
committed
Applied clang-format
1 parent 3e617da commit 07a78fe

File tree

1 file changed

+24
-28
lines changed

1 file changed

+24
-28
lines changed

cpp/autosar/test/rules/A0-1-3/test.cpp

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ void h3() {} // NON_COMPLIANT
8787
} // namespace foo
8888
} // namespace
8989

90-
91-
92-
static int unevaluatedContextFn(int x) { x++; return x; } // COMPLIANT - called in an unevaluated context.
90+
static int unevaluatedContextFn(int x) {
91+
x++;
92+
return x;
93+
} // COMPLIANT - called in an unevaluated context.
9394
#include <typeinfo>
9495
static int unevalContextCaller() // COMPLIANT - address taken
9596
{
@@ -100,13 +101,12 @@ static int unevalContextCaller() // COMPLIANT - address taken
100101
decltype(unevaluatedContextFn(2)) n = 42;
101102
return 0;
102103
}
103-
int (* ptr_unevalContextCaller)(void) = unevalContextCaller;
104-
104+
int (*ptr_unevalContextCaller)(void) = unevalContextCaller;
105105

106106
class X {
107107
private:
108108
[[maybe_unused]] void maybeUnused();
109-
void deleted() = delete; // COMPLIANT - Deleted Function
109+
void deleted() = delete; // COMPLIANT - Deleted Function
110110
};
111111

112112
void X::maybeUnused() {} // COMPLIANT - [[maybe_unused]]
@@ -118,33 +118,29 @@ static int overload1(int c) // COMPLIANT - called
118118

119119
static int overload1(int c, int d) // COMPLAINT - overload1(int) is called.
120120
{
121-
return c+d;
121+
return c + d;
122122
}
123123

124-
namespace
124+
namespace {
125+
int overload1(int c, float d) // COMPLAINT - overload1(int) is called.
125126
{
126-
float overload1(int c, float d) // COMPLAINT - overload1(int) is called.
127-
{
128-
return c+d;
129-
}
127+
return c + d;
130128
}
129+
} // namespace
131130

132131
int overload = overload1(5);
133132

134-
class classWithOverloads
135-
{
136-
public:
137-
int caller(int x)
138-
{
139-
return overloadMember(x,0);
140-
}
141-
private:
142-
int overloadMember(int c) // COMPLAINT - overloadMember(int, int) is called.
143-
{
144-
return ++c;
145-
}
146-
int overloadMember(int c, int d) // COMPLAINT - called.
147-
{
148-
return c+d;
149-
}
133+
class classWithOverloads {
134+
public:
135+
int caller(int x) { return overloadMember(x, 0); }
136+
137+
private:
138+
int overloadMember(int c) // COMPLAINT - overloadMember(int, int) is called.
139+
{
140+
return ++c;
141+
}
142+
int overloadMember(int c, int d) // COMPLAINT - called.
143+
{
144+
return c + d;
145+
}
150146
};

0 commit comments

Comments
 (0)