Skip to content

Commit a456279

Browse files
Update testother.cpp
1 parent 9dd7dbf commit a456279

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/testother.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4664,6 +4664,20 @@ class TestOther : public TestFixture {
46644664
ASSERT_EQUALS("[test.cpp:1:18]: (style) Parameter 'p' can be declared as pointer to const [constParameterPointer]\n"
46654665
"[test.cpp:4:18]: (style) Parameter 'p' can be declared as pointer to const [constParameterPointer]\n",
46664666
errout_str());
4667+
4668+
check("using fp_t = int (*)(int*);\n" // #14510
4669+
"fp_t g_fp;
4670+
"struct S { fp_t m_fp; };
4671+
"void g(fp_t);
4672+
"S f(S* s) {
4673+
" g_fp = [](int* p) { return *p; };
4674+
" s->m_fp = [](int* p) { return *p; };
4675+
" g([](int* p) { return *p; });
4676+
" auto x = [](int* p) { return *p; };
4677+
" g(x);
4678+
" return { [](int* p) { return *p; } };
4679+
"}\n");
4680+
ASSERT_EQUALS("", errout_str());
46674681
}
46684682

46694683
void constArray() {

0 commit comments

Comments
 (0)