vpnor: Fix const decltype() error reported by gcc-11
The latest yocto rebase has brought in a new compiler. It's flagging the
following error with this code:
| ../git/vpnor/table.cpp: In member function 'const pnor_partition& openpower::virtual_pnor::partition::Table::partition(size_t) const':
| ../git/vpnor/table.cpp:159:49: error: 'decltype(auto)' cannot be cv-qualified
| 159 | const decltype(auto) table = getNativeTable();
| |
The function is already returning a const so the declaration of the
variable as a const is redundant (and no longer allowed by the compiler)
Change-Id: I105f7e0a90c87b2618439a49e387ee74b4f5dc79
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/vpnor/table.cpp b/vpnor/table.cpp
index 8d0fab2..89fb934 100644
--- a/vpnor/table.cpp
+++ b/vpnor/table.cpp
@@ -158,7 +158,7 @@
const pnor_partition& Table::partition(size_t offset) const
{
- const decltype(auto) table = getNativeTable();
+ decltype(auto) table = getNativeTable();
size_t blockOffset = offset / blockSize;
for (decltype(numParts) i{}; i < numParts; ++i)
@@ -184,7 +184,7 @@
const pnor_partition& Table::partition(const std::string& name) const
{
- const decltype(auto) table = getNativeTable();
+ decltype(auto) table = getNativeTable();
for (decltype(numParts) i{}; i < numParts; ++i)
{