Add regression test for #8942 (#3321)

This commit is contained in:
chrchr-github 2021-07-01 21:09:06 +02:00 committed by GitHub
parent 426117a30d
commit 7a51fc8232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -79,6 +79,7 @@ private:
TEST_CASE(simple12); // ticket #4620 TEST_CASE(simple12); // ticket #4620
TEST_CASE(simple13); // #5498 - no constructor, c++11 assignments TEST_CASE(simple13); // #5498 - no constructor, c++11 assignments
TEST_CASE(simple14); // #6253 template base TEST_CASE(simple14); // #6253 template base
TEST_CASE(simple15); // #8942 multiple arguments, decltype
TEST_CASE(noConstructor1); TEST_CASE(noConstructor1);
TEST_CASE(noConstructor2); TEST_CASE(noConstructor2);
@ -486,6 +487,23 @@ private:
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }
void simple15() { // #8942
check("class A\n"
"{\n"
"public:\n"
" int member;\n"
"};\n"
"class B\n"
"{\n"
"public:\n"
" B(const decltype(A::member)& x, const decltype(A::member)& y) : x(x), y(y) {}\n"
"private:\n"
" const decltype(A::member)& x;\n"
" const decltype(A::member)& y;\n"
"};\n");
ASSERT_EQUALS("", errout.str());
}
void noConstructor1() { void noConstructor1() {
// There are nonstatic member variables - constructor is needed // There are nonstatic member variables - constructor is needed
check("class Fred\n" check("class Fred\n"