File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5025,6 +5025,32 @@ void beginEnd()
50255025 std::crend (arr);
50265026}
50275027
5028+ struct S_constParameter_std_begin { // #11617
5029+ int a[2 ];
5030+ };
5031+
5032+ struct T_constParameter_std_begin {
5033+ std::vector<int > v;
5034+ };
5035+
5036+ void f (S_constParameter_std_begin& s) {
5037+ std::for_each (std::begin (s.a ), std::end (s.a ), [](auto & i) { ++i; });
5038+ }
5039+
5040+ // cppcheck-suppress constParameterReference - FP
5041+ void f (T_constParameter_std_begin& t) {
5042+ std::for_each (std::begin (t.v ), std::end (t.v ), [](auto & i) { ++i; });
5043+ }
5044+
5045+ void g_constVariable_std_begin (int * p) { *p = 0 ; }
5046+
5047+ int f_constVariable_std_begin () {
5048+ int arr[1 ];
5049+ g_constVariable_std_begin (std::begin (arr));
5050+ *std::begin (arr) = 1 ;
5051+ return arr[0 ];
5052+ }
5053+
50285054void smartPtr_get ()
50295055{
50305056 std::unique_ptr<int > p;
You can’t perform that action at this time.
0 commit comments