@@ -1792,7 +1792,7 @@ class TestOther : public TestFixture {
17921792
17931793 void varScope39() {
17941794 check("struct S {\n" // #12405
1795- " void f(const std::string&) const;\n"
1795+ " void f(const std::string& s ) const;\n"
17961796 " const int* g(std::string&) const;\n"
17971797 "};\n"
17981798 "void h(int);\n"
@@ -3621,7 +3621,7 @@ class TestOther : public TestFixture {
36213621 "class D\n"
36223622 "{\n"
36233623 "public:\n"
3624- " explicit D(int&);\n"
3624+ " explicit D(int& i );\n"
36253625 "\n"
36263626 "private:\n"
36273627 " C c;\n"
@@ -3642,7 +3642,7 @@ class TestOther : public TestFixture {
36423642 "class D\n"
36433643 "{\n"
36443644 "public:\n"
3645- " explicit D(int&) noexcept;\n"
3645+ " explicit D(int& i ) noexcept;\n"
36463646 "\n"
36473647 "private:\n"
36483648 " C c;\n"
@@ -3662,7 +3662,7 @@ class TestOther : public TestFixture {
36623662 "class D\n"
36633663 "{\n"
36643664 "public:\n"
3665- " explicit D(int&);\n"
3665+ " explicit D(int& i );\n"
36663666 "\n"
36673667 "private:\n"
36683668 " C c;\n"
@@ -3683,7 +3683,7 @@ class TestOther : public TestFixture {
36833683 "class D\n"
36843684 "{\n"
36853685 "public:\n"
3686- " explicit D(int&);\n"
3686+ " explicit D(int& i );\n"
36873687 "\n"
36883688 "private:\n"
36893689 " C c;\n"
@@ -3704,7 +3704,7 @@ class TestOther : public TestFixture {
37043704 "class D\n"
37053705 "{\n"
37063706 "public:\n"
3707- " explicit D(int&);\n"
3707+ " explicit D(int& i );\n"
37083708 "\n"
37093709 "private:\n"
37103710 " C c;\n"
@@ -6776,7 +6776,7 @@ class TestOther : public TestFixture {
67766776 " AMethodObject(double, double, double);\n"
67776777 "};\n"
67786778 "struct S {\n"
6779- " static void A(double, double, double);\n"
6779+ " static void A(double a1 , double a2 , double a3 );\n"
67806780 "};\n"
67816781 "void S::A(double const a1, double const a2, double const a3) {\n"
67826782 " AMethodObject(a1, a2, a3);\n"
@@ -8013,7 +8013,7 @@ class TestOther : public TestFixture {
80138013 "public:\n"
80148014 " double getScale() const { return m_range * m_zoom; }\n"
80158015 " void setZoom(double z) { m_zoom = z; }\n"
8016- " void dostuff(int);\n"
8016+ " void dostuff(int x );\n"
80178017 "private:\n"
80188018 " double m_zoom;\n"
80198019 " double m_range;\n"
@@ -12769,6 +12769,17 @@ class TestOther : public TestFixture {
1276912769 "[test.cpp:7:15] -> [test.cpp:8:15]: (style, inconclusive) Function 'h' argument 1 names different: declaration 'a' definition 'b'. [funcArgNamesDifferent]\n",
1277012770 errout_str());
1277112771
12772+ check("void f(int a);\n" // #14632
12773+ "void f(int) {}\n"
12774+ "void g(int);\n"
12775+ "void g(int b) {}\n"
12776+ "void h(int);\n"
12777+ "void h(int) {}\n");
12778+ ASSERT_EQUALS(
12779+ "[test.cpp:1:12]: (style, inconclusive) Function 'f' argument 1 names different: declaration 'a' definition '<unnamed>'. [funcArgNamesDifferent]\n"
12780+ "[test.cpp:4:12]: (style, inconclusive) Function 'g' argument 1 names different: declaration '<unnamed>' definition 'b'. [funcArgNamesDifferent]\n",
12781+ errout_str());
12782+
1277212783 }
1277312784
1277412785 void funcArgOrderDifferent() {
0 commit comments