summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-03-14 22:33:32 +0100
committerStephan Bergmann <sbergman@redhat.com>2023-03-15 19:57:23 +0000
commit5377a98c2cb78b0768d469ff379f9add9aaa7b68 (patch)
tree0d8aeaefc0b08f835a05d69b7105390567723bc5 /connectivity
parent2fd915b7d2d2a9e25600a07587ab01d23bffbc58 (diff)
Silence some false -Werror=dangling-reference
...seen at least with gcc-c++-13.0.1-0.7.fc38.x86_64, > connectivity/source/manager/mdrivermanager.cxx: In lambda function: > connectivity/source/manager/mdrivermanager.cxx:621:41: error: possibly dangling reference to a temporary [-Werror=dangling-reference] > 621 | const DriverAccess& ensuredAccess = EnsureDriver(m_xContext)(driverAccess); > | ^~~~~~~~~~~~~ > connectivity/source/manager/mdrivermanager.cxx:621:81: note: the temporary was destroyed at the end of the full expression ‘drivermanager::{anonymous}::EnsureDriver(this->drivermanager::OSDBCDriverManager::m_xContext).drivermanager::{anonymous}::EnsureDriver::operator()((* & driverAccess))’ > 621 | const DriverAccess& ensuredAccess = EnsureDriver(m_xContext)(driverAccess); > | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ and > vcl/source/window/layout.cxx: In function ‘array_type assembleGrid(const VclGrid&)’: > vcl/source/window/layout.cxx:952:30: error: possibly dangling reference to a temporary [-Werror=dangling-reference] > 952 | const GridEntry &rEntry = A[x][y]; > | ^~~~~~ > vcl/source/window/layout.cxx:952:45: note: the temporary was destroyed at the end of the full expression ‘boost::multi_array_ref<T, NumDims>::operator[](index) [with T = {anonymous}::GridEntry; long unsigned int NumDims = 2; reference = boost::detail::multi_array::sub_array<{anonymous}::GridEntry, 1>; index = long int](((boost::multi_array_ref<{anonymous}::GridEntry, 2>::index)x)).boost::detail::multi_array::sub_array<{anonymous}::GridEntry, 1>::operator[](((boost::detail::multi_array::sub_array<{anonymous}::GridEntry, 1>::index)y))’ > 952 | const GridEntry &rEntry = A[x][y]; > | ^ > vcl/source/window/layout.cxx: In function ‘void calcMaxs(const array_type&, std::__debug::vector<VclGrid::Value>&, std::__debug::vector<VclGrid::Value>&)’: > vcl/source/window/layout.cxx:1075:30: error: possibly dangling reference to a temporary [-Werror=dangling-reference] > 1075 | const GridEntry &rEntry = A[x][y]; > | ^~~~~~ > vcl/source/window/layout.cxx:1075:45: note: the temporary was destroyed at the end of the full expression ‘boost::multi_array_ref<T, NumDims>::operator[](index) const [with T = {anonymous}::GridEntry; long unsigned int NumDims = 2; const_reference = boost::detail::multi_array::const_sub_array<{anonymous}::GridEntry, 1, const {anonymous}::GridEntry*>; index = long int](((boost::multi_array_ref<{anonymous}::GridEntry, 2>::index)x)).boost::detail::multi_array::const_sub_array<{anonymous}::GridEntry, 1, const {anonymous}::GridEntry*>::operator[](((boost::detail::multi_array::const_sub_array<{anonymous}::GridEntry, 1, const {anonymous}::GridEntry*>::index)y))’ > 1075 | const GridEntry &rEntry = A[x][y]; > | ^ > vcl/source/window/layout.cxx:1106:30: error: possibly dangling reference to a temporary [-Werror=dangling-reference] > 1106 | const GridEntry &rEntry = A[x][y]; > | ^~~~~~ > vcl/source/window/layout.cxx:1106:45: note: the temporary was destroyed at the end of the full expression ‘boost::multi_array_ref<T, NumDims>::operator[](index) const [with T = {anonymous}::GridEntry; long unsigned int NumDims = 2; const_reference = boost::detail::multi_array::const_sub_array<{anonymous}::GridEntry, 1, const {anonymous}::GridEntry*>; index = long int](((boost::multi_array_ref<{anonymous}::GridEntry, 2>::index)x)).boost::detail::multi_array::const_sub_array<{anonymous}::GridEntry, 1, const {anonymous}::GridEntry*>::operator[](((boost::detail::multi_array::const_sub_array<{anonymous}::GridEntry, 1, const {anonymous}::GridEntry*>::index)y))’ > 1106 | const GridEntry &rEntry = A[x][y]; > | ^ Change-Id: I498bb468ade52f83117c8cf57f8d64697978d9ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148921 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/manager/mdrivermanager.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx
index dbc35c2c4072..c4b884cc973b 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -607,7 +607,14 @@ Reference< XDriver > OSDBCDriverManager::implGetDriverForURL(const OUString& _rU
m_aDriversBS.end(), // end of search range
[&_rURL, this] (const DriverAccessArray::value_type& driverAccess) {
// extract the driver from the access, then ask the resulting driver for acceptance
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdangling-reference"
+#endif
const DriverAccess& ensuredAccess = EnsureDriver(m_xContext)(driverAccess);
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#pragma GCC diagnostic pop
+#endif
const Reference<XDriver> driver = ExtractDriverFromAccess()(ensuredAccess);
return AcceptsURL(_rURL, driver);
});