diff --git a/test/testclass.cpp b/test/testclass.cpp index fc0d7a5aa..f751f46fc 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -172,6 +172,7 @@ private: TEST_CASE(const63); // ticket #5983 TEST_CASE(const64); // ticket #6268 TEST_CASE(const65); // ticket #8693 + TEST_CASE(const66); // ticket #7714 TEST_CASE(const_handleDefaultParameters); TEST_CASE(const_passThisToMemberOfOtherClass); TEST_CASE(assigningPointerToPointerIsNotAConstOperation); @@ -5632,6 +5633,16 @@ private: ASSERT_EQUALS("", errout.str()); } + void const66() { + checkConst("struct C {\n" + " C() : n(0) {}\n" + " void f(int v) { g((char *) &v); }\n" + " void g(char *) { n++; }\n" + " int n;\n" + "};\n"); + ASSERT_EQUALS("", errout.str()); + } + void const_handleDefaultParameters() { checkConst("struct Foo {\n" " void foo1(int i, int j = 0) {\n"