From 6cfcf8610df5928d113977ffd1224459400c1ac3 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Thu, 14 Sep 2017 00:12:10 +0300 Subject: [PATCH] Improve coverage for operator= return type detection. This adds a testcase with parameter being a reference to non-const. --- test/testclass.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/testclass.cpp b/test/testclass.cpp index 2004f5ada..83f33b8ae 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -772,6 +772,14 @@ private: "};"); ASSERT_EQUALS("", errout.str()); + checkOpertorEq("class A\n" + "{\n" + "public:\n" + " void goo() {}" + " void operator=(A&);\n" + "};"); + ASSERT_EQUALS("[test.cpp:4]: (style) 'A::operator=' should return 'A &'.\n", errout.str()); + checkOpertorEq("class A\n" "{\n" "private:\n"