#8631: Added regression test

This commit is contained in:
orbitcowboy 2021-08-23 08:51:54 +02:00
parent e1d0db38ee
commit 4ff0db1ec4
1 changed files with 10 additions and 0 deletions

View File

@ -39,6 +39,7 @@ private:
TEST_CASE(ptrcompare);
TEST_CASE(ptrarithmetic);
TEST_CASE(returnIssues);
TEST_CASE(assignment);
}
void check(const char code[]) {
@ -56,6 +57,15 @@ private:
check64BitPortability.pointerassignment();
}
void assignment() {
// #8631
check("using CharArray = char[16];\n"
"void f() {\n"
" CharArray foo = \"\";\n"
"}");
ASSERT_EQUALS("", errout.str());
}
void novardecl() {
// if the variable declarations can't be seen then skip the warning
check("void foo()\n"