libstdc++: Fix dangling reference in filesystem::path::filename()
The new -Wdangling-reference warning noticed this. libstdc++-v3/ChangeLog: * include/bits/fs_path.h (path::filename()): Fix dangling reference.
This commit is contained in:
parent
b80f25a336
commit
49237fe6ef
1 changed files with 3 additions and 3 deletions
|
@ -1262,9 +1262,9 @@ namespace __detail
|
|||
{
|
||||
if (_M_pathname.back() == preferred_separator)
|
||||
return {};
|
||||
auto& __last = *--end();
|
||||
if (__last._M_type() == _Type::_Filename)
|
||||
return __last;
|
||||
auto __last = --end();
|
||||
if (__last->_M_type() == _Type::_Filename)
|
||||
return *__last;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue