File tree Expand file tree Collapse file tree 1 file changed +11
-17
lines changed
cpp/autosar/test/rules/M0-1-3 Expand file tree Collapse file tree 1 file changed +11
-17
lines changed Original file line number Diff line number Diff line change @@ -46,41 +46,35 @@ void test_side_effect_init() {
46
46
// have side effects
47
47
}
48
48
49
- #include < cstdio>
50
49
#include < array>
51
- template <int t>
52
- class CharBuffer
53
- {
54
- public:
50
+ #include < cstdio>
51
+ template <int t> class CharBuffer {
52
+ public:
55
53
int member[t];
56
- CharBuffer (): member{0 }{}
54
+ CharBuffer () : member{0 } {}
57
55
};
58
56
59
- int test_constexpr_in_template_inst ()
60
- {
57
+ int test_constexpr_in_template_inst () {
61
58
constexpr int line_length = 1024U ; // COMPLIANT - used in template inst.
62
59
// of buffer.
63
60
CharBuffer<line_length> buffer{};
64
61
return buffer.member [0 ];
65
62
}
66
63
67
64
enum DataType : unsigned char {
68
- int8,
69
- int16,
65
+ int8,
66
+ int16,
70
67
};
71
68
72
- template <typename ... Types>
73
- int test_constexpr_in_static_assert ()
74
- {
75
- const std::array <DataType, sizeof ...(Types)> lldts {int8};
76
- const std::array <DataType, sizeof ...(Types)> llams {int16};
69
+ template <typename ... Types> int test_constexpr_in_static_assert () {
70
+ const std::array<DataType, sizeof ...(Types)> lldts{int8};
71
+ const std::array<DataType, sizeof ...(Types)> llams{int16};
77
72
constexpr std::size_t mssu = 64 * 1024 ; // COMPLIANT - used in static assert.
78
73
static_assert ((sizeof (lldts) + sizeof (llams)) <= mssu, " assert" );
79
74
return 0 ;
80
75
}
81
76
82
- int baz ()
83
- {
77
+ int baz () {
84
78
test_constexpr_in_static_assert<int >();
85
79
return 0 ;
86
80
}
You can’t perform that action at this time.
0 commit comments