We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a5a7dd7 commit 20e63bcCopy full SHA for 20e63bc
1 file changed
test/testnullpointer.cpp
@@ -4830,6 +4830,15 @@ class TestNullPointer : public TestFixture {
4830
"[test.cpp:5:20]: note: Assignment 'f=fopen(notexist,t)', assigned value is 0\n"
4831
"[test.cpp:6:8]: note: Calling function foo, 1st argument is null\n"
4832
"[test.cpp:2:13]: note: Dereferencing argument f that is null\n", errout_str());
4833
+
4834
+ ctu("void g(std::optional<int>& o) {\n" // #14728
4835
+ " *o = 1;\n"
4836
+ "}\n"
4837
+ "void f() {\n"
4838
+ " std::optional<int> x = 0;\n"
4839
+ " g(x);\n"
4840
+ "}\n");
4841
+ ASSERT_EQUALS("", errout_str());
4842
}
4843
};
4844
0 commit comments