Add regression test for #7714 (#1648)

Ticket #7714 was fixed in ea215c3b7b.
Add a regression test to make sure it stays fixed.
This commit is contained in:
rikardfalkeborn 2019-02-07 08:49:55 +01:00 committed by amai2012
parent 633e8632f5
commit aa730f45c6
1 changed files with 11 additions and 0 deletions

View File

@ -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"