diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index 627d2d68bbc..9247efaf73a 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -5085,4 +5085,14 @@ void constParameterReference_assign(std::vector& v, int& r) { void constParameterReference_insert(std::list& l, int& r) { l.insert(l.end(), r); l.insert(l.end(), 5, r); -} \ No newline at end of file +} + +const char* variableScope_cstr_dummy(const char* q); // #12812 +std::size_t variableScope_cstr(const char* p) { + std::string s; + if (!p) { + s = "abc"; + p = variableScope_cstr_dummy(s.c_str()); + } + return std::strlen(p); +}