Skip to content

Commit 918547b

Browse files
Update testother.cpp
1 parent 183fa19 commit 918547b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎test/testother.cpp‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2787,6 +2787,17 @@ class TestOther : public TestFixture {
27872787
"}\n");
27882788
ASSERT_EQUALS("", errout_str());
27892789

2790+
check("struct S {\n" // #15130
2791+
" union {\n"
2792+
" int i;\n"
2793+
" struct {\n"
2794+
" char a[24];\n"
2795+
" } x;\n"
2796+
" };\n"
2797+
"};\n"
2798+
"int f(S s) { return s.i; }\n");
2799+
ASSERT_EQUALS("[test.cpp:9:9]: (performance) Function parameter 's' should be passed by const reference. [passedByValue]\n", errout_str());
2800+
27902801
/*const*/ Settings settingsWin64 = settingsBuilder().platform(Platform::Type::Win64).build();
27912802
check("using ui64 = unsigned __int64;\n"
27922803
"ui64 Test(ui64 one, ui64 two) { return one + two; }\n",

0 commit comments

Comments
 (0)