File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1416,7 +1416,7 @@ void CheckOther::checkPassByReference()
1416
1416
if (inconclusive && !mSettings ->certainty .isEnabled (Certainty::inconclusive))
1417
1417
continue ;
1418
1418
1419
- if (var->isArray () && var->getTypeName () != " std::array " )
1419
+ if (var->isArray () && (! var->isStlType () || Token::simpleMatch (var-> nameToken ()-> next (), " [ " )) )
1420
1420
continue ;
1421
1421
1422
1422
const bool isConst = var->isConst ();
Original file line number Diff line number Diff line change @@ -2440,6 +2440,9 @@ class TestOther : public TestFixture {
2440
2440
"int h(const std::array<std::vector<int>, 2> a) { return a[0][0]; }\n");
2441
2441
ASSERT_EQUALS("[test.cpp:4]: (performance) Function parameter 'a' should be passed by const reference.\n", errout_str());
2442
2442
2443
+ check("void f(const std::array<int, 10> a[]) {}\n"); // #13524
2444
+ ASSERT_EQUALS("", errout_str());
2445
+
2443
2446
/*const*/ Settings settings1 = settingsBuilder().platform(Platform::Type::Win64).build();
2444
2447
check("using ui64 = unsigned __int64;\n"
2445
2448
"ui64 Test(ui64 one, ui64 two) { return one + two; }\n",
You can’t perform that action at this time.
0 commit comments