File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ class TestUninitVar : public TestFixture {
9797 TEST_CASE (uninitvar_memberfunction);
9898 TEST_CASE (uninitvar_nonmember); // crash in ycmd test
9999 TEST_CASE (uninitvarDesignatedInitializers);
100+ TEST_CASE (uninitvarFunctionPointer);
100101
101102 TEST_CASE (isVariableUsageDeref); // *p
102103 TEST_CASE (isVariableUsageDerefValueflow); // *p
@@ -7773,6 +7774,17 @@ class TestUninitVar : public TestFixture {
77737774 ASSERT_EQUALS (" " , errout_str ());
77747775 }
77757776
7777+ void uninitvarFunctionPointer () {
7778+ checkUninitVar (" void g(int* p);\n "
7779+ " void f() {\n "
7780+ " int *p;\n "
7781+ " void (*a[1])(int* p) = { g } ;\n "
7782+ " p = 0;\n "
7783+ " a[0](p);\n "
7784+ " }\n " );
7785+ ASSERT_EQUALS (" " , errout_str ());
7786+ }
7787+
77767788 void isVariableUsageDeref () {
77777789 // *p
77787790 checkUninitVar (" void f() {\n "
You can’t perform that action at this time.
0 commit comments