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