Skip to content

Commit 7a51fc8

Browse files
Add regression test for #8942 (#3321)
1 parent 426117a commit 7a51fc8

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

test/testconstructors.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class TestConstructors : public TestFixture {
7979
TEST_CASE(simple12); // ticket #4620
8080
TEST_CASE(simple13); // #5498 - no constructor, c++11 assignments
8181
TEST_CASE(simple14); // #6253 template base
82+
TEST_CASE(simple15); // #8942 multiple arguments, decltype
8283

8384
TEST_CASE(noConstructor1);
8485
TEST_CASE(noConstructor2);
@@ -486,6 +487,23 @@ class TestConstructors : public TestFixture {
486487
ASSERT_EQUALS("", errout.str());
487488
}
488489

490+
void simple15() { // #8942
491+
check("class A\n"
492+
"{\n"
493+
"public:\n"
494+
" int member;\n"
495+
"};\n"
496+
"class B\n"
497+
"{\n"
498+
"public:\n"
499+
" B(const decltype(A::member)& x, const decltype(A::member)& y) : x(x), y(y) {}\n"
500+
"private:\n"
501+
" const decltype(A::member)& x;\n"
502+
" const decltype(A::member)& y;\n"
503+
"};\n");
504+
ASSERT_EQUALS("", errout.str());
505+
}
506+
489507
void noConstructor1() {
490508
// There are nonstatic member variables - constructor is needed
491509
check("class Fred\n"

0 commit comments

Comments
 (0)