forked from qt-creator/qt-creator
Clang: Fix FilePathView constructor
Do not keep pointer of a temporary object. Change-Id: I5251c7dbc8581be96afaa947e1a58adaeb0b17e3 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
committed by
Marco Bubke
parent
9ad760efda
commit
21b8e10814
@@ -45,8 +45,9 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename String>
|
template <typename String,
|
||||||
explicit FilePathView(String filePath)
|
typename = std::enable_if_t<std::is_lvalue_reference<String>::value>>
|
||||||
|
explicit FilePathView(String &&filePath)
|
||||||
: FilePathView(filePath.data(), filePath.size())
|
: FilePathView(filePath.data(), filePath.size())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -44,8 +44,9 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename String>
|
template <typename String,
|
||||||
explicit NativeFilePathView(String filePath)
|
typename = std::enable_if_t<std::is_lvalue_reference<String>::value>>
|
||||||
|
explicit NativeFilePathView(String &&filePath)
|
||||||
: NativeFilePathView(filePath.data(), filePath.size())
|
: NativeFilePathView(filePath.data(), filePath.size())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user