File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ class TestNullPointer : public TestFixture {
140140 TEST_CASE (nullpointer101); // #11382
141141 TEST_CASE (nullpointer102);
142142 TEST_CASE (nullpointer103);
143+ TEST_CASE (nullpointer104); // #13881
143144 TEST_CASE (nullpointer_addressOf); // address of
144145 TEST_CASE (nullpointerSwitch); // #2626
145146 TEST_CASE (nullpointer_cast); // #4692
@@ -2919,6 +2920,15 @@ class TestNullPointer : public TestFixture {
29192920 TODO_ASSERT_EQUALS (" " , " [test.cpp:3:10]: (warning) Possible null pointer dereference: p [nullPointer]\n " , errout_str ());
29202921 }
29212922
2923+ void nullpointer104 () // #13881
2924+ {
2925+ check (" using std::max;\n "
2926+ " void f(int i) {\n "
2927+ " const size_t maxlen = i == 1 ? 8 : (std::numeric_limits<std::size_t>::max());\n "
2928+ " }\n " );
2929+ ASSERT_EQUALS (" " , errout_str ());
2930+ }
2931+
29222932 void nullpointer_addressOf () { // address of
29232933 check (" void f() {\n "
29242934 " struct X *x = 0;\n "
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ class TestSimplifyUsing : public TestFixture {
7171 TEST_CASE (simplifyUsing33);
7272 TEST_CASE (simplifyUsing34);
7373 TEST_CASE (simplifyUsing35);
74+ TEST_CASE (simplifyUsing36);
7475
7576 TEST_CASE (simplifyUsing8970);
7677 TEST_CASE (simplifyUsing8971);
@@ -873,6 +874,14 @@ class TestSimplifyUsing : public TestFixture {
873874 ASSERT_EQUALS (" " , errout_str ());
874875 }
875876
877+ void simplifyUsing36 () {
878+ const char code[] = " using A::a;\n "
879+ " int c = B<int>::a;\n " ;
880+ const char expected[] = " int c ; c = B < int > :: a ;" ;
881+ ASSERT_EQUALS (expected, tok (code));
882+ ASSERT_EQUALS (" " , errout_str ());
883+ }
884+
876885 void simplifyUsing8970 () {
877886 const char code[] = " using V = std::vector<int>;\n "
878887 " struct A {\n "
You can’t perform that action at this time.
0 commit comments